#include <hidef.h> /* common defines and macros */
#include <MC9S12XS128.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12xs128"
void set_pull()
{
REFDV=1;
SYNR=2;
while(!(CRG**&0x08));
CLKSEL=0x80;
}
void AD_init()
{
ATD0CTL1=0x00;
ATD0CTL2=0x40;
ATD0CTL3=0xa0;
ATD0CTL4=0x01;
ATD0CTL5=0x30;
ATD0DIEN=0x00;
}
void AD_GET(word *AD_wValue)
{
*AD_wValue=ATD0DR0;
}
void main()
{
set_pull();
AD_init();
DDRB=0xff;
PORTB=0x00;
EnableInterrupts;
for(;;)
{
while(!ATD0STAT2_CCF0);
AD_GET(&AD_wValue);
PORTB=AD_wValue;
}
}
那位朋友能帮我解释解释这个指针问题吗?我的程序编译有错误,如传的图所示。那位朋友能帮助帮助小弟吗?非常感谢…… |