Freescale/NXP MPC5606B: ADC1 Scan Mode Program


TRK-MPC5606B
Here, ADC1 on TRK-MPC5606B board is used to test Read Analog Input.

ADC stands for Analog to Digital Converter.
ADC1 on TRK-MPC5606B is a 12-bit ADC.

ADC1_ScanMoode example for MPC5606B (Tested on TRK-MPC5606B Board)

Description:
Converts inputs ANP0, ANP1 and ANP2 of (ADC1 - 12bit - 0 to 4096) using scan mode (continuous).

Reading Analog input (0 to 5V) using ANP0 and Its output is shown using 4 LEDs as below.

Program Outcome:
Analog INPUT                    => OUTPUT (PB[4])  [LED1 LED2 LED3 LED4]  
DigitalOutcomeValue (0-1000)    => ON OFF OFF OFF 
DigitalOutcomeValue (1001-2000) => ON ON  OFF OFF 
DigitalOutcomeValue (2001-3000) => ON ON  ON  OFF 
DigitalOutcomeValue (4001-5000) => ON ON  ON  ON



Problem Statement:Reading Analog input (0 to 5V) using ANP0 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 ADC1_Channel   PORT    SIU_PAD_CONFIG   PACKAGE_PIN (100 144 176)
ANP0   => CH0         B4      PCR[20]=2000     50  72  88
ANP1   => CH1         B5      PCR[21]=2000     53  73  91
ANP2   => CH2         B6      PCR[22]=2000     54  76  92

Connect Jumper J19 and J20 in (2-3) Position to provide Supply to ADC1 module

NOTE:1. Do not forget to add "ME.PCTL[68].R = 0x01;" line in void initModesAndClock(void) function to make ADC1 work.
2. On TRK-MPC5606B Board, Connect Jumper J19 and J20 in (2-3) Position to provide Supply to ADC1 module

Downloads:
ADC1_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
Post a Comment (0)
Previous Post Next Post