Connecting 8031 microcontroller to external program memory

Thread Starter

Amirali Sadeghi Farshi

Joined Aug 7, 2017
4
Hi,

I want to use an external EPROM for program memory. I've connected the EA pin to ground and I've loaded the code onto the EPROM(I've checked the contents in Proteus and it's correct). The problem is, when I run the simulation in Proteus without a program file for 8031 itself, nothing happens. I mean the address bits on port 0 and 2 get stuck at 0xFFFF and ALE and PSEN are also stuck at 1. If I load the program file on 8031, the code runs ok, however port 0 and 2 still don't output the address and increment it as needed. (Again stuck at 0xFFFF but this time ALE works fine and makes port 0 float as ALE is pulled down). What am I doing wrong?!
Capture.JPG
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
Just a guess but when A15 is high like it would be for FFFFh, it looks like the RAM will be on the bus when PSEN goes low during instruction fetch. CE/ is low and PSEN/ enables reading the RAM which has no program.
 
Last edited:

Thread Starter

Amirali Sadeghi Farshi

Joined Aug 7, 2017
4
Just a guess but when A15 is high like it would be for FFFFh, it looks like the RAM will be on the bus when PSEN goes low during instruction fetch. CE/ is low and PSEN/ enables reading the RAM.
Yeah that's right. To be detailed, the first 8KBs in the address space is for EPROM and the last 32KBs (from 8000H to FFFFH) is for RAM. What I expext is that when I've connected EA to GND, port 0 and 2 should be initialized to zero and read the instructions one by one and automatically increment the address on these two ports, but it doesn't happen!
 

JohnInTX

Joined Jun 26, 2012
4,787
Yeah that's right. To be detailed, the first 8KBs in the address space is for EPROM and the last 32KBs (from 8000H to FFFFH) is for RAM. What I expext is that when I've connected EA to GND, port 0 and 2 should be initialized to zero and read the instructions one by one and automatically increment the address on these two ports, but it doesn't happen!
It should start executing at 0000h of course. Is OE/ on the '373 strapped low?

Failing that, I'd strap the RAM's chip enable high temporarily to make sure it is out of the picture.
 

Thread Starter

Amirali Sadeghi Farshi

Joined Aug 7, 2017
4
Also, strangely, WR pin gets zero periodically
It should start executing at 0000h of course. Is OE/ on the '373 strapped low?

Failing that, I'd strap the RAM's chip enable high temporarily to make sure it is out of the picture.
Yup, it is strapped low! I also removed the ROM completely :D Still the same :(
Suspiciously, WR pin also gets zero periodically! I don't understand why since I'm not trying to write anything anywhere! And debugger shows the instruction is NOP for all PCs :D
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
Also, strangely, WR pin gets zero periodically

Yup, it is strapped low! I also removed the ROM completely :D Still the same :(
Suspiciously, WR pin also gets zero periodically! I don't understand why since I'm not trying to write anything anywhere! And debugger shows the instruction is NOP for all PCs :D
Yean.. the WR/ should not be active. Try a simple program of a few NOPs with a GOTO 0 in a loop and see if it can run that way i.e. without RAM access instructions and not accessing that address space.
Hmm.. I wonder if there is a problem with the simulator itself recognizing EA low. It would not be the first time.. You might ask Proteus about that.

EDIT: make sure RST is low.
 
Last edited:

Thread Starter

Amirali Sadeghi Farshi

Joined Aug 7, 2017
4
Yean.. the WR/ should not be active. Try a simple program of a few NOPs with a GOTO 0 in a loop and see if it can run that way i.e. without RAM access instructions and not accessing that address space.
Hmm.. I wonder if there is a problem with the simulator itself recognizing EA low. It would not be the first time.. You might ask Proteus about that.

EDIT: make sure RST is low.
I'm not using any RAM access instructions... I think Proteus is somehow messing up.
 
Top