#define c0 XBYTE[0xeffc]
#define c1 XBYTE[0xeffd]
#define c2 XBYTE[0xeffe]
#define m XBYTE[0xefff]
sbit gate=P1^0;
sbit cs_8253=P2^4;
void init_8253()
{
m=0x34;
c0=0;
c0=0;
m=0x74;
c1=0;
c1=0;
m=0xb4;
c2=0;
c2=0;
}
main()
{
uchar cnt0[2];
uchar cnt1[2];
uchar cnt2[2];
gate=0;
init_8253();
gate=1;
m=0x00; //锁存
cnt0[0]=c0;
cnt0[1]=c0;
m=0x40;
cnt1[0]=c1;
cnt1[1]=c1;
m=0x80;
cnt2[0]=c2;
cnt2[1]=c2;
可是我读出来的不是我赋的初值,请问是怎么回事 |