Issue to stop using eprom & continue using RAM in 8051 microcontroller

Hi, I have a C51 using external eprom and RAM memory, but I want to start using the internal flash memory of the CI, but the external RAM memory.
The microcontroller I'm using is the Megawin MPC59E515A. (Datasheet: http://www.brighteamtech.com.tw/UpLoad/572/006090100010/MPC89E515A_A9.pdf )

So, I changed the pin 31 (/EA) from gnd to 5V, changed these variables:
AUXR (08Eh) <- #11b (to stop using the internal RAM memory and use the external)
XICON (0C0h) <- #00 (external interrupt control)
P4 (0E8h) <- #00 (I/O Port)

and commented the code parts that uses the eprom memory.

Then I made the following code to test the external memory

tram_loop:
mov a,#35h
mov dptr,#7ffeh ;tests the 62256 RAM memory
mov 08Eh,#03
mov 0C0h,#00
mov 085h,#00
mov 0E8h,#00
movx @dptr,a
mov a,#16h
mov dptr,#7fffh ;two bytes in the end
movx @dptr,a

mov dptr,#7ffeh
movx a,@dptr
clr c
subb a,#35h
jnz tram_loop
mov dptr,#7fffh
movx a,@dptr
clr c
subb a,#16h
jnz tram_loop

But it will never get out of the loop... not even the first jnz.
Any help, please?


Helder
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories