![Freescale Semiconductor QE128 Скачать руководство пользователя страница 78](http://html1.mh-extra.com/html/freescale-semiconductor/qe128/qe128_quick-reference-user-manual_2330661078.webp)
Using the Analog to Digital Converter (ADC) for the QE Microcontrollers
QE128 Quick Reference User Guide, Rev. 1.0
8-6
Freescale Semiconductor
UINT8 temp; // Create a temp variable used for further operations
temp = ~ADCRL; // Negate the ADC converted value because is going to be display
// on the LEDs (The LEDs turn on with 0's)
PTED = (UINT8) (temp & 0xC0); // Move the adquired ADC value to port E
PTCD = (UINT8) (temp & 0x3F); // Move the adquired ADC value to port C
}
8.3.2
Hardware Implementation
Figure 8-2. ADC Hardware Implementation
NOTE
This example is developed using the CodeWarrior version 6.0 for the
HCS08 and V1 families. It is expressly made for the MCF51QE128 and
MC9S08QE128 (64-pin package). There may be changes needed in the
code to initialize another MCU.