??? 12/15/08 04:45 Read: times |
#160931 - I/Os expansion: AT89S8252 (Urgent help needed!) |
Hi everyone,
Could anyone please explain to me why we can read the inputs and turn on outputs from this IOs expansion of AT89S8252. I mean why we have 01000h for I1_8 rather than any other address. Please follow the link to see the schematic file: http://www.8052.com/users/gho...ansion.pdf And here is the code: ;----------------------------------- ;File: 8052.def - To define the IOs ;----------------------------------- ;I/O Addressing ;Inputs I1_8 xdata 01000h I9_16 xdata 00800h I17_24 xdata 00400h ;Outputs O1_8 xdata 08000h O9_16 xdata 04000h O17_24 xdata 02000h ;Watchdog ;WMCON Watchdog & Memory Control AT89S8252 only Load to B WDTEN bit B.0 ;Watchdog timer enable = 1 WDTRST bit B.1 ;Watchdog reset and EEPROM rdy/bsy flag. DPS bit B.2 ;Data pointer register select EEMEN bit B.3 ;Internal EEPROM access enable = 1 MOVX instruction EEMWE bit B.4 ;EEPROM data memory write PS0 bit B.5 ;Prescaler for watchdog timer PS1 bit B.6 ;Prescaler for watchdog timer PS2 bit B.7 ;Prescaler for watchdog timer Inputs1_8 data 0x2a ;8 direct inputs bit to process 1-8 Inputs9_16 data 02bh ;8 direct inputs bit to process 9-16 Inputs17_24 data 02ch ;8 direct inputs bit to process 17-24 ;------------------------------------------ ; File: IOs.h - to read I/P and turn on O/P ;------------------------------------------ mov B,WMCON clr EEMEN ;Disable EEPROM read mov WMCON,B ;and save mov DPTR,#I1_8 ;Read inputs and save to bit addressed area. movx A,@DPTR mov Inputs1_8,A nop nop mov DPTR,#I9_16 movx A,@DPTR mov Inputs9_16,A nop nop mov DPTR,#I17_24 movx A,@DPTR mov Inputs17_24,A nop nop mov B,WMCON setb EEMEN ;Enable EEPROM read mov WMCON,B ;and save This software developed by other person who already left. The program works fine with AT89S8252, but when I migrate the code to AT89S8253, the board could not read the IOs from those addresses. I wonder the addresses to read I1_8, I9_16 and I17_24 and similar for the O/Ps are changed? And if yes, then to what addresses! Thanks, |
Topic | Author | Date |
I/Os expansion: AT89S8252 (Urgent help needed!) | 01/01/70 00:00 | |
I/O address decoder | 01/01/70 00:00 | |
I/O address decoder![]() | 01/01/70 00:00 |