Are there code examples how to read Analog pins ADC0_SE on the MK60?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Are there code examples how to read Analog pins ADC0_SE on the MK60?

1,305 Views
kevinbrown
Contributor I

Are there code examples how to read Analog pins ADC0_SE on the MK60?

0 Kudos
6 Replies

1,101 Views
kevinbrown
Contributor I

MCUXpresso IDE had an example how to do analog reads that worked great. 

Now I am working on MK60FX512VMD12 which does not have an example how to use analog reads and wrights from MCUXpresso.  Where can I find help on reading analog pins on the MK60FX512VMD12?

0 Kudos

1,101 Views
mjbcswitzerland
Specialist V

Kevin

The same code can be used for all Kinetis (K) ADCs - the only possible exception being the number of ADCs, the number of ADC pins and muxing ADC pins that can be shared with other functions.

Regards

Mark

0 Kudos

1,101 Views
kevinbrown
Contributor I

In my working code I included fsl_adc16.h files from MK60 and then MK64 and got the following error for both.

C:\KB\PBOOT\Hardware\Kinetis\ADC\CMSIS\fsl_device_registers.h:52:6: error: #error "No valid CPU defined!"
MK60FX512VMD12 is not a defined CPU

I also tried adjusting the MK60 and MK64 adc16_polling examples for MK60FX512VMD12 with no luck. 

Other adc.h files from NXP only work for other processor not for MK60FX512VMD12.  Is there an adc.h file that will work with the MK60FX512VMD12 or is there a MK60FX512VMD12.h file I could use with adc.h?

0 Kudos

1,101 Views
mjbcswitzerland
Specialist V

Hi

I think that you will need to use a device that is supported since the FSL libraries require a complete new set of headers for each part and when the exact part doesn't exist you will may have a lot of work building up a new set. Since the K60 is an old part I also don't expect any interest in this being done officially.

Probably your best strategy is to select the closest part to the one you use and try it. The ADC will be not different so it should work in this sense.

If you don't make progress try the uTasker project since it uses a different strategy requiring only one library and set of headers of all Kinetis parts and so you can move between any Kinetis device without difficulties or need to re-developing existing code.

Regards

Mark

0 Kudos

1,101 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Kevin,

Please download the SDK_2.2_TWR-K60D100M package refer Generating a downloadable MCUXpresso SDK v.2 package.

And then you can find the ADC examples in it's folder. (For example: C:\SDK_2.2_TWR-K60D100M\boards\twrk60d100m\driver_examples\adc16)

SDK_2.2_TWR-K60D100M ADC examples.jpg

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,101 Views
mjbcswitzerland
Specialist V
0 Kudos