Error in data bus while writing

For discussing the 65xx hardware itself or electronics projects.
Post Reply
diego2000
Posts: 2
Joined: 11 May 2020
Location: Italy

Error in data bus while writing

Post by diego2000 »

Hi everyone, I'm bulding a simple computer with a Rockwell 6502P, but I'm having problems with the writing process.

I connected the 6502 to an arduino and to a w27c512 EPROM to test it. I loaded the code for load the accumulator with memory and then push it into the stack.

When it's time to write the memory, the R/W pin goes LOW, the EPROM is set in high impedence state (because of the A15 pin goes LOW), but the data bus of the 6502 seems to remain in high impedence state or reading state.
In fact, the arduino reads in the data bus the same byte of the previous instruction, and if I put a 10Kohm resistor as pull-up on each line of the bus, the byte read is FF.

The pin that I connected to the Vcc are: IRQ, NMI, VCC, RES, SO, BE.
PHI2 frequency is 10Hz.
RDY is connected to Vcc with a 1Kohm resistor.

What can I do? Could be the chip bad?

Thanks.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Error in data bus while writing

Post by BigEd »

Welcome!

If you really do mean 10Hz, that's too slow for an old non-CMOS 6502. It will lose track of what it is doing.

Instead, clock at 1MHz and use some form of single-stepping circuit (search this forum for suggestions)
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Error in data bus while writing

Post by Dr Jefyll »

diego2000 wrote:
When it's time to write the memory, the R/W pin goes LOW, the EPROM is set in high impedence state (because of the A15 pin goes LOW), but the data bus of the 6502 seems to remain in high impedence state or reading state.
The issue Ed mentioned may also have a bearing. But... When do you sample the data bus?

Every cycle has two halves... the first half when Phi2 is low, and the 2nd half when it's high.

During the first half, the conditions you describe are NORMAL for a write cycle. The CPU remains high-impedance until Phi2 goes high. THEN is when you need to take your sample (if you're not doing it that way already).

If you continue to have difficulty please post a photo and a schematic. This will help us to advise you.

Cheers, and welcome!
ps- on this forum you may attach images to your post :)

-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
gbm
Posts: 43
Joined: 23 Jan 2018

Re: Error in data bus while writing

Post by gbm »

So you don't reset your CPU? It may or may not work then. How about RDY line?
diego2000
Posts: 2
Joined: 11 May 2020
Location: Italy

Re: Error in data bus while writing

Post by diego2000 »

Dr Jefyll wrote:
During the first half, the conditions you describe are NORMAL for a write cycle.
You're right, I misunderstood the timing diagrams. Now I make the sample after the rising edge and everything works :D .
BigEd wrote:
that's too slow for an old non-CMOS 6502
That was what also I thought, but I seen that even at 10Hz registers don't lose their values... anyway the single-stepping ciruit is exactly what I was searching for

Thank you all.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Error in data bus while writing

Post by BigEd »

Good result!
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Error in data bus while writing

Post by Chromatix »

It could be that your CPU is actually a CMOS chip in disguise. Try loading this little routine into it to find out for sure.
Post Reply