#include “inc.h”
#include
#include
#include
extern const uchar qct[];
uint16_t data0,data1;
uint8_t bitcnt;
uint8_t CaptureOK;
uint16_t ms,Sec;
uint32_t MsCnt; //ms count
void Shift(uint da)
{
uchar i;
}
void Scan(void)
{
uchar i,j;
uint m;
const char * n;
const uchar Mask[]={1,2,4,8,16,128,32,64,128,128,64,128,32,64,128,128,64,128,128};
const uchar OETAB[]={PIX,PIX/16,PIX/8,PIX/4,PIX/2,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX,PIX};
for(m=0;m<4596;m+=3)
}
void Delay(void)
{
uint i,j;
for(i=0;i<400;i++)
}
void timer0_init(void)
{
}
void int0_ini(void)
{
MCUCR=(1<
}
SIGNAL(SIG_OVERFLOW0)
{
TCNT0 = 0xfe;//0xe1;; //重装初值
ms++;
MsCnt++;
if(MsCnt>100000)
}
SIGNAL (SIG_INTERRUPT0)
{
static uint oldFall;
uint temp,newFall;
newFall=ms;
if(newFall>oldFall)
else
oldFall=newFall;
if(temp>80&& temp<130) // "0"信号1.125ms
else if(temp>170 && temp<220) //“1”信号2.25ms
bitcnt++;
if(bitcnt<16) //开端接纳前16位
else if(bitcnt==16)
}
void IO_ini(void)
{
PORTB=0xff;
PORTC=0Xff;
PORTD=0Xff;
DDRD=(1<
DDRC=(1<
}
int main(void)
{
IO_ini();
int0_ini();
timer0_init();
sei();
CLR_LED2;
CLR_OE;
while(1)
}