#include /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
void main(void) { unsigned char abc_result[10];
unsigned int j;
unsigned char TEMP;
EnableInterrupts; /* enable interrupts */
/* include your code here */
DDRA=0XFF;
CONFIG1=0X09;
ADCLK=0X30;
ADSCR=0X20; //COCO AIEN通道是0
for(;;) {
if(ADSCR_COCO==1)
TEMP=ADR;
PTA=TEMP;
ADSCR=0X00;
} /* loop forever */
/* please make sure that you never leave main */
}
这是我写的AD 转换试验的程序接线都是正确的但为何不能运行呢
|