Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 3 months ago.
Manually configure the ADC Module of K64F
Hi Everyone,
I would like to manually configure the ADC of the K64F by programming the registers directly. Currently, I haven't made it very far because I believe the MCU throws an exception when I try to write to the registers. I believe this is because I haven't "turned on" the ADC module yet. However, I do now know how to do this. Has anyone tried to manually configure any of the registers in the K64F? I would like to do this so I can setup interrupts between the timer module and the ADC module.
Thanks!
Damien
Just figured it out, classic:
You need to enable the module's clock in the SIM_SCGC6 or SIM_SCGC3 register. Therefore the code would be:
The attached file is a nice summary of how to manually configure the ADC.
/media/uploads/defrost/frdm-k64_adc_configuration.pdf
posted by Damien Frost 29 Jul 2015Here is a library I wrote to use the A/D in differential mode, you can use it as a template. https://developer.mbed.org/users/JimCarver/code/AnalogIn_Diff/file/7b36e4381d83/AnalohIn_Diff.cpp
posted by Jim Carver 29 Jul 2015