Where can I find a code example for the ADC16 IRQ handler setup and usage? Code examples seem severely lacking on this platform. I am using Kinetis with KSDK 2.0 and MKL17Z256VLH4.
Hi Jim
http://www.utasker.com/docs/uTasker/uTaskerADC.pdf
Code for ADC interrupt, ADC DMA, ADC level interrupts available in the open source project at links below. ADC is simulated in Visual Studio for more development efficiency.
All code will run on any Kinetis without the usual porting issues.
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
Kinetis KL25, KL26, KL27, KL28, KL82, KL43, KL46
- http://http://www.utasker.com/kinetis/FRDM-KL25Z.html
- http://www.utasker.com/kinetis/TWR-KL25Z48M.html
- http://www.utasker.com/kinetis/FRDM-KL26Z.html
- http://www.utasker.com/kinetis/TEENSY_LC.html
- http://www.utasker.com/kinetis/FRDM-KL27Z.html
- http://www.utasker.com/kinetis/Capuccino-KL27.html
- http://www.utasker.com/kinetis/FRDM-KL28Z.html
- http://www.utasker.com/kinetis/FRDM-KL82Z.html
- http://www.utasker.com/kinetis/FRDM-KL43Z.html
- http://www.utasker.com/kinetis/TWR-KL43Z48M.html
- http://www.utasker.com/kinetis/FRDM-KL46Z.html
- http://www.utasker.com/kinetis/TWR-KL46Z48M.html
Build with: CW10.x, KDS, MCUXpresso, IAR, Keil, Greenhills, Crossworks, CooCox, Atollic, S32 Design Studio, GNU Make and Visual Studio
Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M
For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html
Hi Jim
If you are restricted to KSDK you may be able to find someone who has added the missing features in the KDSK forum: https://community.nxp.com/community/mcuxpresso/kinetis-software-development-kit
or you may need to upgrade to SDK 2.3 which includes a basic interrupt example.
If you need to upgrade it yourself manually it is only two additional operations as follows (using simple end of conversion interrupt):
1. Enter the ADC's interrupt handler into the vector table and enable this interrupt with its required interrupt priority
2. Set the ADC_SC1A_AIEN bit in the ADC0_SC1A register
Then start the conversion as normal and the interrupt will fire when it completes.
Regards
Mark