main{
ATD1PE = 0x01; /* Write breaks the conversion */
ATD1C = 0xA0; /* Write breaks the conversion */
ATD1SC = 0x40; /* Write starts a new conversion */
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
interrupt 23 void Vatd1_isr(void)
{
result = ATD1RH; /* Read result and acknowledge interrupt */
ATD1SC = ATD1SC; /* Re-Start Conversion for Ch1 */
}