ioport unsigned int *ADCCTL1=(unsigned int *)0x6800;
ioport unsigned int *ADCDATA1=(unsigned int *)0x6801;
ioport unsigned int *ADCCLKDIV1=(unsigned int *)0x6802;
ioport unsigned int *ADCCLKCTL1=(unsigned int *)0x6803;
#define ADCCTL (*ADCCTL1)
#define ADCDATA (*ADCDATA1)
#define ADCCLKDIV (*ADCCLKDIV1)
#define ADCCLKCTL (*ADCCLKCTL1)
void InitADC();
void wait( unsigned int cycles );
void EnableAPLL( );
unsigned int nADC0[512];
main()
{
int i;
unsigned int uWork;
EnableAPLL();
//InitADC();
PLL_Init(132);
while ( 1 )
{
for ( i=0;i<512;i++ )
{
ADCCTL=0x8000; // 启动AD转换,通道0
do
{
uWork=ADCDATA;
} while (uWork&0x8000);
nADC0[i]=uWork&0x0fff;
}