void main(void)
{
sei;
InitIcs();
InitRISC();
InitPort();
InitTimer();
InitSpi();
InitSci();
cli;
for (;;)
{
FND_Display(0xaa,0xaa);
COP_REFRESH; //喂狗
}
}
void InitSpi(void)
{
SPCR1=0x50;
SPBR=0x8b;
}
void FND_Display(byte Count_DG,byte Count_Data)
{
byte kp;
for(kp=0 ; kp<3 ; kp++);
//while(IS_SPI_TRA_EMPTYN); SPDR=Count_Data; // 000x xxxx
while(! (SPSR & 0x20) ); SPDR=Count_Data;
FND_Count_H;
for(kp=0 ; kp<15 ; kp++);
FND_Count_L;
for(kp=0 ; kp<3 ; kp++);
//while(IS_SPI_TRA_EMPTYN); SPDR=Count_DG; // 0000 0010
while(! (SPSR & 0x20)); SPDR=Count_DG;
FND_DG_H;
for(kp=0 ; kp<15 ; kp++);
FND_DG_L;
COP_REFRESH; //{asm sta aSRS;}
} |