-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Conversation
iabdalkader
commented
Jan 14, 2014
- 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.
example: |
What will be the recommended way to run the STM32F407 ADC's at 2.4MHz or -- Charlie On Tue, Jan 14, 2014 at 10:37 AM, Ibrahim Abd Elkader <
|
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. |
The processor has the speed to handle the 2 to 7MHz data stream to a
-- Charlie On Tue, Jan 14, 2014 at 12:15 PM, Ibrahim Abd Elkader <
|
* Add ADC support for reading internal temperature sensor. * Add ADC support for reading internal VREF/VBAT monitor.
@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. |
Python callbacks do work: just pass along a function (eg lambda) as the entity to call back. |
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. |
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. |
Add max stack usage tracking, visible via debug module ustack. Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
Adapted from adafruit#175 f91493c Dan Halbert: Measure and report maximum stack usage. (micropython#175)