6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 3:54 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Jul 24, 2018 5:54 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
In another thread, BigEd made a remark concerning clock skew.
BigEd wrote:
Probably pictures would help here a lot more than words!
As the topic has arisen more than once I decided to have a go at this.

Attachment:
timing skew (mem late).png
timing skew (mem late).png [ 2.83 KiB | Viewed 2329 times ]
Here (above) is what you'll see in a typical 6502 or 65C02 setup where the memory /WR and /RD signals are qualified by the CPU clock. I've shown the address bus changing instantly when Phi2 goes low although in fact there is some delay. We can discuss that detail (and others such as the delay between Phi2 IN and Phi2 OUT) later, but right now an overview seems in order, and my goal is to show what must ultimately go wrong when /RD and /WR are delayed "too much." Too much delay means you can end up reading from or writing to an incorrect address at the end of the cycle. A few ns of this might be tolerable, but... :|


Attachment:
timing skew (mem early).png
timing skew (mem early).png [ 2.58 KiB | Viewed 2329 times ]
The hazards seem less pronounced when /RD and /WR are early. Toward the end of a read cycle, memory will tristate the data bus before the CPU has closed its input latch which accepts the data, but that's harmless (assuming the DC loading on the data bus is negligible and capacitance can be relied upon to sustain the logic levels, as no other device is driving the bus after Phi2 falls). (nb: comment not applicable to 65816!) The other hazards are simply reduced time allowances as seen from memory's POV. But IC specifications tend to be conservative, and to create a problem I think you'd have to make /RD and /WR very early indeed. However, taken too far...

- reads will commence before the address is valid, which is harmless provided there's enough time after it becomes valid.
- writes will commence before the data is valid, which is harmless provided there's enough time after it becomes valid.
- writes will commence before the address is valid. A few ns of this might be tolerable, but...

Comments/additions/corrections welcome, :)

Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Tue Jul 24, 2018 7:28 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 24, 2018 6:07 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Thanks Jeff, that's great! Might be worth noting that a stray read could be harmful, for example if it cleared an interrupt flag in an I/O device.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 27, 2018 6:03 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Jeff, are you suggesting that it's better not to qualify /W and /R with phi-2?

Also, you might want the add the case where /W and /R go active co-incidental with the rise of Phi-2. I had done that in my investigations with my Jaguar project by delaying Phi-2 going to the CPU.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 27, 2018 7:17 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
The takeaway, I think, is that /R should be deasserted late and /W should be deasserted early.

One way to do this might be to insert a couple of inverters between the oscillator and the CPU, producing Phi0 and Phi2 signals (and Phi1 in-between). Then /R can be derived as ~(Phi2 & R/W) as usual, and /W can be derived as ~(Phi0 & Phi2 & ~R/W) in a 3-NAND gate.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: