Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
void PORT_INIT(void)
{ PTBDD = 0xFF; // all Pins are Output pins
PTBD = 0xFF; // all pins Initial condition logic'0'
PTBPE = 0x00; // desiable the all pull ups for the port(B)
}
void ADC_INIT(void)
{ PTADD_PTADD1=0; // PTA's 1st pin as a input pin (for ADC)
ADCCFG =0x40; // high Speed, divided 4 Input CLK, short sample time and 8-bit conv mode
ADCSC2 =0x00; // software trigger
ADCSC1 =0x41; // Interrupt (AIEN)enable and continuous conversion
}
interrupt 19 void ADC_ISR(void)
{ a0=ADCRL; // Read the 8-Bit ADC value
if(a0>60)
{ PTBD_PTBD6=~PTBD_PTBD6; // routine statements
a0=0; // continues....
}
ADCSC1 =0x41; // Clear the COCO Flag after complete the interupt routine
}
Hi.
there was a problem when i copied the code and tried to run it.
i dint understand what the interrupt 19 was for.
can anyone please tell me more about this coding for MC9S08QG8.
i need a code for ADC.
reply as soon as possible.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.