芯片使用 HCS08GB60
外部晶振 4MHz
程序
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 */
}
能进中断,但是结果一致为0
|