我想通过8155扩展芯片,让数码管显示,一直弄不出来,各位看看有什么问题
#include
#include
#define unit unsigned int
#define uchar unsigned char
#define COM XBYTE[0x7f00]
#define PA XBYTE[0x7f01]
#define PB XBYTE[0x7f02]
#define PC XBYTE[0x7f03]
***it IO = P2^3;
unsigned char code table_seg[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x98,0xa0,0x83,
0xa7,0xa1,0x86,0x8e,
0xff };
unsigned char code table_bit[]={
0x01,0x02,0x04,0x08,
0x10,0x20,0x40,0x80
};
void delay ( unsigned int num,x,y)
{
for (x=num; x>0;x--)
for (y=110; y>0; y--)
{
;
}
}
void main (void)
{
IO = 1 ;
COM = 0x0c;
while(1)
{
P0 = 0x01;
PB = table_bit[1];
PA = table_seg[1];
delay(500);
}
}
|