Buffers and latches... when and how do I use them?
Buffers and latches... when and how do I use them?
I'm still unclear on exactly when to use a buffer or a latch, or a transceiver in a typical 6502 design. I don't really understand the difference between a buffer or latch, or how they work. Can some of you smart experienced guys give a rookie a primer? 
Re: Buffers and latches... when and how do I use them?
In a very small design you probably don't need any of them, but:
- a buffer will add drive to a signal. You'd use one when you are driving a lot of loads, or a long distance, or both, and your signal is unidirectional, like an address bus or the clock. You might use a buffer to delay a signal but that's not robust and needs care.
- a tristate buffer acts as a buffer and can also not drive the output (that is, let the output be driven by something else.) This is good for time-sharing a bus, for example the CPU needs to drive the addresses of a RAM chip, and so does the video chip. (But not both at the same time.) Both drivers can use a tristate buffer to drive a shared bus.
- a transceiver acts as a bidirectional buffer: it drives in one direction or the other, depending on a control input. That's useful for a long distance or highly loaded data bus, where the CPU might need to read or write data to the RAM
- a latch has a clock input and can hold a value. One use is to hold the top 8 bits of the address value in a 65816 system, where the databus drives this value for just the first half of a clock cycle, and then reverts to normal bidirectional data mode for the second half.
For a simple design, see http://searle.hostei.com/grant/6502/Simple6502.html
The later CMOS versions of the 6502 have pretty high drive, and we rarely build multi-board RAM systems these days, so buffering of signals is done less than it used to be.
- a buffer will add drive to a signal. You'd use one when you are driving a lot of loads, or a long distance, or both, and your signal is unidirectional, like an address bus or the clock. You might use a buffer to delay a signal but that's not robust and needs care.
- a tristate buffer acts as a buffer and can also not drive the output (that is, let the output be driven by something else.) This is good for time-sharing a bus, for example the CPU needs to drive the addresses of a RAM chip, and so does the video chip. (But not both at the same time.) Both drivers can use a tristate buffer to drive a shared bus.
- a transceiver acts as a bidirectional buffer: it drives in one direction or the other, depending on a control input. That's useful for a long distance or highly loaded data bus, where the CPU might need to read or write data to the RAM
- a latch has a clock input and can hold a value. One use is to hold the top 8 bits of the address value in a 65816 system, where the databus drives this value for just the first half of a clock cycle, and then reverts to normal bidirectional data mode for the second half.
For a simple design, see http://searle.hostei.com/grant/6502/Simple6502.html
The later CMOS versions of the 6502 have pretty high drive, and we rarely build multi-board RAM systems these days, so buffering of signals is done less than it used to be.
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Buffers and latches... when and how do I use them?
Good synopsis, Ed.
Since you mentioned use of a latch with the 65C816 to capture the bank bits, I will mention that a transceiver is also used on the data bus so that the latter itself does not see the bank bits during Ø2 low. It appears that this is an essential requirement if any of the WDC periperhals (6521, 6522 and 6551) are part of the machine.
Since you mentioned use of a latch with the 65C816 to capture the bank bits, I will mention that a transceiver is also used on the data bus so that the latter itself does not see the bank bits during Ø2 low. It appears that this is an essential requirement if any of the WDC periperhals (6521, 6522 and 6551) are part of the machine.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Buffers and latches... when and how do I use them?
BigEd wrote:
You might use a buffer to delay a signal but that's not robust and needs care.
BigDumbDinosaur wrote:
It appears that this is an essential requirement if any of the WDC periperhals (6521, 6522 and 6551) are part of the machine.
cheers,
Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Buffers and latches... when and how do I use them?
Dr Jefyll wrote:
BigDumbDinosaur wrote:
It appears that this is an essential requirement if any of the WDC periperhals (6521, 6522 and 6551) are part of the machine.
This should not be a matter of concern with peripheral silicon that has separate /CS, /OE and /WE control inputs, as the latter two can be gated by Ø2 so the device doesn't connect to the data bus when Ø2 is low. That is how I arranged it in POC.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Buffers and latches... when and how do I use them?
BigDumbDinosaur wrote:
The timing diagram doesn't really make it clear as to whether such a condition is an issue. Use of the bus transceiver as depicted on page 46 of the 65C816 data sheet would assure that the 'C22 can't be confused by the bank bits. Hence my use of "It appears..."
This should not be a matter of concern with peripheral silicon that has separate /CS, /OE and /WE control inputs, as the latter two can be gated by Ø2 so the device doesn't connect to the data bus when Ø2 is low.
This should not be a matter of concern with peripheral silicon that has separate /CS, /OE and /WE control inputs, as the latter two can be gated by Ø2 so the device doesn't connect to the data bus when Ø2 is low.
It's true there'd be a problem if a peripheral device connected to the data bus when the '816 CPU's Ø2 is low. And, as you say, with peripheral devices featuring the /RD & /WR interface the problem can be avoided by gating those signals with Ø2 (externally, as on the POC).
The same principle applies with 65xx peripherals. However, with 65xx devices the gating is internal -- no external gates are required. They will not input or output data when Ø2 is low. The 65c22 datasheet spills the beans.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html