I am using an ADC peripheral driver to take measurements of voltage.
I am using sdk 1.3.0 and the MK22F board
I used PE to set up the ADC.
I see the the PE_low_level_init(); function the ADC in initalized but how do I use it.
I already checked the ADC examples in C:/freescale/sdk1.3.0/examples....
I could not get the projects to build I shall include my project in case you need it.
Here are the functions that I am using to try to read the ADC value
ADC16_DRV_SetChnMux(0, 0);
val = ADC16_DRV_GetConvValueRAW(0, (uint32_t)0);
The project's name is Worktax.
Original Attachment has been moved to: worktrax.zip
已解决! 转到解答。
If you are using FRDM-K22F board, download the FRDM-K22F-SCH Schematics from this weblink.
You need check whether the crystal(Y1) and C31\C38 are soldered correct.
That fei_blpi example works because it did't use the external crystal as clock source.
If the crystal is correct soldered, then other examples will works.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
Since you are using FRDM-K22F board, why not direct test the ADC demo examples in SDK_2.1_FRDM-K22F?
Search 'K22F' then select FRDM-K22F board.
After specify additional configuration settings, you can download SDK_2.1_FRDM-K22F.
You can getting start with KSDK and KDS from reading below:
"How to start with KSDK" and "KDS Document List".
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you for the replies I have done this however and could not get the Demo to run it will build and debug for non of the functionality on any of the demo apps has worked for me or my colleague.
not sure what the problem is.
I also do have the Platform project that is necessary to build the projects with.
any ideas?
Hi Jace,
It looks like the examples in SDK_2.1_FRDM-K22F never works on your FRDM-K22F board.
From your first question "HardFault problem in KDS using K22F ", hardfault happens when trying to run CLOCK_InitOsc0() function. Have you ever modified the crystal circuit of FRDM-K22F board?
Would you please try to run the fei_blpi example( ...\SDK_2.1_FRDM-K22F\boards\frdmk22f\driver_examples\mcg\fei_blpi).
If that example works(the Green LED blink), you may need to check your crystal circuit.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
If you are using FRDM-K22F board, download the FRDM-K22F-SCH Schematics from this weblink.
You need check whether the crystal(Y1) and C31\C38 are soldered correct.
That fei_blpi example works because it did't use the external crystal as clock source.
If the crystal is correct soldered, then other examples will works.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------