Skip to content

Add missing ADC driver #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 14, 2014
Merged

Add missing ADC driver #175

merged 3 commits into from
Jan 14, 2014

Conversation

iabdalkader
Copy link
Contributor

  • Add missing ADC driver from STM32F4xx_StdPeriph_Lib_V1.3.0

* Add missing ADC driver from STM32F4xx_StdPeriph_Lib_V1.3.0
* Add simple ADC driver, with support for ADC1 and all channels.
* Export MicroPython ADC object with read_channel function.
* Add stm32f4xx_adc.c and adc.c to Makefile.
@iabdalkader
Copy link
Contributor Author

example:
adc = pyb.ADC(resolution) //resolution is not actually used yet
data = adc.read_channel(n) //where n is 0..15

@AWCharlie
Copy link

What will be the recommended way to run the STM32F407 ADC's at 2.4MHz or
interleaver for 7.2MHz?

-- Charlie

On Tue, Jan 14, 2014 at 10:37 AM, Ibrahim Abd Elkader <
notifications@github.com> wrote:

example:
adc = pyb.ADC(resolution) //resolution is not actually used yet
data = adc.read_channel(n) //where n is 0..15


Reply to this email directly or view it on GitHubhttps://github.com//pull/175#issuecomment-32293011
.

@iabdalkader
Copy link
Contributor Author

I'm not sure yet, the ADC is a beast! this driver only support a subset of the functionality, i.e. single conversion mode, no interleaved or group conversion support is implemented yet.. I'm also working on internal temperature sensor and vbat/verf readings.

@AWCharlie
Copy link

The processor has the speed to handle the 2 to 7MHz data stream to a
circular buffer and do some processing to detect an event (something I need

  • along with the DSP). A clean way to get to this through Python has eluded
    me so far. A PC style ISR is not very appealing but may be what works. I
    have done a lot of ARM assembly language but Thumb2 has eliminated some of
    my best tricks.

-- Charlie

On Tue, Jan 14, 2014 at 12:15 PM, Ibrahim Abd Elkader <
notifications@github.com> wrote:

I'm not sure yet, the ADC is a beast! this driver only support a subset of
the functionality, i.e. single conversion mode, no interleaved or group
conversion support is implemented yet.. I'm also working on internal
temperature sensor and vbat/verf readings.


Reply to this email directly or view it on GitHubhttps://github.com//pull/175#issuecomment-32302750
.

* Add ADC support for reading internal temperature sensor.
* Add ADC support for reading internal VREF/VBAT monitor.
@iabdalkader
Copy link
Contributor Author

Example:
s210

@iabdalkader
Copy link
Contributor Author

@ARMWorks I'm not sure if python callbacks are implemented yet, that would be nice to have, and I'm sure more features will be added to this driver in the future.

@dpgeorge
Copy link
Member

Python callbacks do work: just pass along a function (eg lambda) as the entity to call back.

dpgeorge added a commit that referenced this pull request Jan 14, 2014
@dpgeorge dpgeorge merged commit a04a33f into micropython:master Jan 14, 2014
@dpgeorge
Copy link
Member

That's very cool (although your core temp runs hot!).

BTW, if you want to get rid of the timeout errors, uncomment the mma_init() call in main.

@iabdalkader
Copy link
Contributor Author

That's very cool (although your core temp runs hot!).

Yes I noticed that too, according to the datasheet the offset of the temperature function varies from one chip to another up to 45 degrees! and so it's not to supposed to be used as an absolute temperature measurement, it should be used for detecting temperature variations.

tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Aug 14, 2017
Add max stack usage tracking, visible via debug module ustack.
Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
romanz pushed a commit to romanz/micropython that referenced this pull request Mar 17, 2019
Adapted from adafruit#175

f91493c Dan Halbert:  Measure and report maximum stack usage. (micropython#175)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants