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

Migrate from 89C51RD2 to 89C51RE2

I am in process to replace 89C51RD2 to 89C51RE2. Before get into bank switching code, I try to use code from RD2 to program into RE2. All works (UART, Timer1, Timer2, Serial etc..), except SPI on PORT1 did not work same as RD2.

Then I am using L51_BANK.A51 with B_MODE=4 and recompile with using BL51 and OC51. I use the following to generate HEX-386 as the following as you suggest:

the common scheme is
bank 0 0x00000 - 0x07FFF (always there)
bank 1 0x08000 - 0x0FFFF addressed as 0x8000 - 0xffff
bank 2 0x10000 - 0x17FFF addressed as 0x8000 - 0xffff
bank 3 ox18000 - 0x1FFFF addressed as 0x8000 - 0xffff

oc51 dbug.omf

OH51 DBUG.B00 hexfile(dbug.H00)
OH51 DBUG.B01 hexfile(dbug.H01)
OH51 DBUG.B02 hexfile(dbug.H02)
OH51 DBUG.B03 hexfile(dbug.H03)

HEX2BIN /L131072 DBUG.H00 DBUG.BIN
HEX2BIN /O32767 /M DBUG.H01 DBUG.BIN
HEX2BIN /O65536 /M DBUG.H02 DBUG.BIN
HEX2BIN /O98304 /M DBUG.H03 DBUG.BIN
BIN2HEX /4 DBUG.BIN DBUG2.HEX

If I place serial communication process command in common area, it works fine.... However, if I place into other bank code... It did not execute. It is very strange because I am able to step through with Keil debugger.

Therefore, I don't know am I place code bank right? or is DataMan 48Pro+ programmer work? Is 89C51RE2 compatible with RD2? or Do I using L51_BANK properly with B_MODE=4?