//--------------------------------------------------------------------------------------- // Programm Nr.: 10 // Content : ADC (single conversion) on pressing a key + output high byte on PORT D // Author : digital AG Halle // Date : 16.07.2008 // System : ATmega8-16PU - Dai Hoc Hue Development Board //--------------------------------------------------------------------------------------- //--included Files----------------------------------------------------------------------- #include //--declarations------------------------------------------------------------------------- #ifndef F_CPU #define F_CPU 8000000 //CPU frequency = 8 MHz #endif uint8_t KEYS; uint8_t KEYS_OLD; //internal 10-bit analog digital converter uint8_t result_H; //high byte result ADC (bit 9-8) uint8_t result_L; //low byte result ADC (bit 7-0) //--MAIN PROGRAMM------------------------------------------------------------------------ int main(void) { //--INITIALISATION--------------------------------------------------------------- //ADC_INIT: ADMUX |= (1<