#include /* common defines and macros */
#include /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12c32"
unsigned char tmect,tmrti,tempdt,period,duty;
volatile void ECT_Init(void)
{
TSCR1=0x80;
TSCR2=0x80;
}
void main(void)
{ /* put your own code here */
DDRA=0b00000001;
DDRB=0b00010000;
ECT_Init();
PORTA=0;
PORTB=0;
EnableInterrupts;
for(;;)
{
if(tmect<127)
{
PORTB_BIT4=0;
} else
{
PORTB_BIT4=1;
}
} /* wait forever */ }
volatile void interrupt 16 ETI_Int(void)
{
TFLG2_TOF=1;
tmect++;
}
我是写在主程序里的,能够运行
[此贴子已经被作者于2005-11-22 20:04:30编辑过] |