This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

use P0(A0~A7), no use P2(A8~A15)

MPU:AT89C51
1.When 16-bits(A0~A15) address system,
I set 8255 CS(chip sele.) address at 0xD000,
the C program :

#define PA_1      XBYTE[0xD000]
#define PB_1      XBYTE[0xD001]
#define PC_1      XBYTE[0xD002]
#define CNTLW_1   XBYTE[0xD003]

Now,I want to create a 8-bits address systems(0x00~0xff),
the 8255 decoder is 0xD0.
Plese help me, How to use XBYTE at C program?

2.Is the program correct???( at 8-bits )
#define PA_1      XBYTE[0xD0]
#define PB_1      XBYTE[0xD1]
#define PC_1	  XBYTE[0xD2]
#define CNTLW_1   XBYTE[0xD3]

0