
ADC stands for Analog to Digital Converter.
ADC0 on TRK-MPC5606B is a 10-bit ADC.
ADC0_ScanMoode example for MPC5606B (Tested on TRK-MPC5606B Board)
Description:
Converts inputs ANS0, ANS1 and ANS2 using scan mode (continuous).
Reading Analog input (0 to 5V) using ANS0 and Its output is shown using 4 LEDs as below.
Program Outcome:
Analog INPUT => OUTPUT (PB[8]) [LED1 LED2 LED3 LED4] DigitalValue (0-200) => ON OFF OFF OFF DigitalValue (201-500) => ON ON OFF OFF DigitalValue (501-800) => ON ON ON OFF DigitalValue (801-1023) => ON ON ON ON
Problem Statement:Reading Analog input (0 to 5V) using ANS0 and Its output is shown using 4 LEDs as below.
Connections:
LED No. => Port No. => Pad No. => Pin No.(144-pin LQFP package) LED1 => PE[4] => PCR[68] => PIN 132 LED2 => PE[5] => PCR[69] => PIN 133 LED3 => PE[6] => PCR[70] => PIN 139 LED4 => PE[7] => PCR[71] => PIN 140 SIGNAL ADC0_Channel PORT SIU_PAD_CONFIG PACKAGE_PIN (100 144 176) ANS0 => 32 B8 PCR[24]=2000 39 53 R9 ANS1 => 33 B9 PCR[25]=2000 38 52 T9 ANS2 => 34 B10 PCR[26]=2000 40 54 P9
Downloads:
ADC0_ScanMode_TRK-MPC5606B_APDaga
Click here to see more codes for Freescale/NXP MPC56xx Family.
Feel free to ask doubts in the comment section. I will try my best to solve it.
If you find this helpful by any mean like, comment and share the post.
This is the simplest way to encourage me to keep doing such work.
Thanks and Regards,
-Akshay P. Daga