What is this capacitor up to? - RC6502

Building your first 6502-based project? We'll help you get started here.
Post Reply
Paganini
Posts: 516
Joined: 18 Mar 2022

What is this capacitor up to? - RC6502

Post by Paganini »

Can anyone explain what this capacitor is doing here?
20220320_121749.jpg
I'm getting ready to build an RC6502 multi-board system. This will be my first "engineering" retrocomputing project (I mean, using real parts, solder, schematics, and so on) as opposed to "science" projects, like "From Nand 2 Tetris" and SICP (all logic and theory centered, relying on emulation and such). While I'm waiting for my PCBs to be delivered I've been studying the schematics.

This is from the schematic for the serial I/O board. Is it good practice to connect two output pins together into one signal like this? If I remember, in Nand2Tetris, connecting two outputs together to a single input is simply an illegal operation, so I don't understand what this part of the circuit is trying to do.

I have some other questions that may be cleared up when I understand what that capacitor is for. Why is the high-order bit of of port B called "DA" instead of D7 after it is wired together with CB2? Why is the capacitor here an electrolytic (polarized) one, while the same circuit in the SBC version of this design has a ceramic (non-polarized) one? According to the WD65C21 datasheet, pin CB2 is bi-directional, but this particular design seems to using it only as an output pin; I thought maybe the capacitor has something to do with keeping current from going the wrong way through the inverter, but wouldn't you use a diode for that?
"The key is not to let the hardware sense any fear." - Radical Brad
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: What is this capacitor up to? - RC6502

Post by BigEd »

Welcome!

I don't know the answer, but I can say it looks a bit like the original, which can be seen at the Apple 1 Registry
Attachments
clip from apple 1 schematic
clip from apple 1 schematic
Paganini
Posts: 516
Joined: 18 Mar 2022

Re: What is this capacitor up to? - RC6502

Post by Paganini »

Hey Ed! Thanks! Finding the schematic for the original Apple I so I could compare was on my list of things to do this afternoon!
"The key is not to let the hardware sense any fear." - Radical Brad
leepivonka
Posts: 167
Joined: 15 Apr 2016

Re: What is this capacitor up to? - RC6502

Post by leepivonka »

So far I've got:

The 6821 & associated circuitry is designed to be like the Apple I to software.
PB6..0 are character data to the terminal. They are programmed as outputs by WozMon.
PB7 is programmed to be an input by WozMon. It is high when data is available for the terminal.
CB2 is programmed to be a handshaking line by WozMon. It is low after PB is written, high after CB1 goes low.
The capacitor is intended to keep the output from hanging forever if the CB1 ack doesn't come; but I haven't found the pulldown on OUT_DA yet.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: What is this capacitor up to? - RC6502

Post by GARTHWILSON »

Welcome.

What does this get connected to?

You won't find any electrolytic capacitors (or any other polarized types either for that matter) in 10nF (.01µF). I suspect whoever drew it got lazy and just grabbed that library component instead of looking for the right one. Even if it really were polarized, it suggests that the inverter's output would never be high when PB7 is low.

Something definitely seems to be out of place though, for multiple reasons. [Edit: leepivonka above answered this, apparently posting just as I started writing.]
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Paganini
Posts: 516
Joined: 18 Mar 2022

Re: What is this capacitor up to? - RC6502

Post by Paganini »

Hi Garth!
GARTHWILSON wrote:
Welcome.

What does this get connected to?
In a real Apple I it's part of the connection between the "CPU" area of the motherboard and the "Terminal" area of the motherboard; this signal, specifically, goes to a 74174 chip that is part of a (to me!) extremely complex circuit that is purported to mange carriage returns. Theoretically, for the RC6502, it goes to an Arduino Nano that operates as a terminal emulator. I am not planning to involve the Arduino in my build, however. :) There's a pin-header for all the terminal signals so that you can (e.g.) hook up a real Apple I keyboard or replica of such if you happen to have one.
GARTHWILSON wrote:

You won't find any electrolytic capacitors (or any other polarized types either for that matter) in 10nF (.01µF). I suspect whoever drew it got lazy and just grabbed that library component instead of looking for the right one. Even if it really were polarized, it suggests that the inverter's output would never be high when PB7 is low.
OK that makes some sense! Thanks!

I found this explanation at SB-Projects:
Quote:
Acknowledge Circuit
The clipping above shows the acknowledge circuitry. Its purpose is to signal the acceptance of the character by the terminal to the software. You won't find the circuit as it is drawn here in the original documentation. The left half of it is on the processor sheet, while the right half is on the terminal sheet. Both halves are interconnected by the signals DA and RDA.
Writing a character to the PIA's terminal output automatically clears the output CB2. This will make PB7 high, signaling to the software that it is no longer allowed to write new data to the output. Once this signal is clocked into C7 it is combined with the CURSOR signal. This combined signal is then also combined with the 2 most significant bits of the printed ASCII character. Only when at least one of these two bits is "1" AND the CURS signal is "1" the WRITE signal is asserted. This prevents CTRL characters from being written to the screen, which would be meaningless because the character ROM can not display CTRL characters.
When the CURS signal becomes active the one shot generator B3 is triggered to generate a 3.5µs pulse to the CB1 input of the PIA, which will effectively clear the status of CB2. From then on the software is free to write a new character to the terminal again.
leepivonka wrote:
PB7 is programmed to be an input by WozMon. It is high when data is available for the terminal.
CB2 is programmed to be a handshaking line by WozMon. It is low after PB is written, high after CB1 goes low.
The capacitor is intended to keep the output from hanging forever if the CB1 ack doesn't come; but I haven't found the pulldown on OUT_DA yet.
This clears up my confusion about tying the lines together... I was imagining PB7 to be an output pin, because of how the RC6502 schematic is drawn - confusingly! It is in fact the CB2 output that feeds both the PB7 input *and* is the OUT_DA signal. Woof! Thanks for pointing me in the right direction, guys!
"The key is not to let the hardware sense any fear." - Radical Brad
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: What is this capacitor up to? - RC6502

Post by gfoot »

Paganini wrote:
This clears up my confusion about tying the lines together... I was imagining PB7 to be an output pin, because of how the RC6502 schematic is drawn - confusingly! It is in fact the CB2 output that feeds both the PB7 input *and* is the OUT_DA signal. Woof! Thanks for pointing me in the right direction, guys!
If PB7 did act as an output, it looks like it could lead to out-of-range voltages appearing in various places. For example, suppose PB7 was low and the inverter's output was high, then the capacitor would charge to 5V; then if PB7 goes high, now the inverter's output is being pushed up to 10V by the capacitor. In an opposite set of circumstances it would be pushed down to -5V; and the same could happen in reverse to push PB7 to out-of-range voltages. So even though the capacitor would prevent much current flowing for very long, it could still be damaging to the ICs involved which aren't expecting to deal with voltages outside their GND-VCC range.
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: What is this capacitor up to? - RC6502

Post by barrym95838 »

gfoot, it looks like you found the Apple 1's version of "the killer poke"!
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
John West
Posts: 383
Joined: 03 Sep 2002

Re: What is this capacitor up to? - RC6502

Post by John West »

I'm assuming there's a pull-up resistor on whatever it's connected to (it looks like it goes straight into an Arduino, and I don't have the patience to track down how the software is configuring that pin). If that's the case, this is a high-pass filter, and the capacitor will be converting a low-going edge into a short low pulse.
Start with the output from the inverter high and the capacitor discharged. OUT_DA will be high. If the inverter output goes low, there is still 0V across the capacitor and OUT_DA gets pulled low too. Current now flows through the pull-up resistor, charging the capacitor and OUT_DA will eventually reach 5V again. The result is a low-going pulse.
If the inverter output then goes high, OUT_DA will be pushed up to twice the supply voltage. That's still seen as a 'high' signal, so as far as the Arduino is concerned, nothing has happened. Now it's getting discharged through both the resistor and the protection diode on the input it's connected to, so the voltage on OUT_DA will drop back to 5V quickly. The capacitor now has 0V across it, and we can start again.
10nF is a fairly small capacitor. It won't hold a lot of energy, and that is the sort of situation the protection diodes are there for. Still, it doesn't make me comfortable. I'd have put a series resistor in there to reduce the current through them. Actually, I wouldn't have done it this way at all - I'd configure the input on the Arduino to do the edge detection for me if that's possible, or do it in software if it isn't. But I don't know the details of how this is supposed to work; there might be good reasons for doing it like this.
Paganini
Posts: 516
Joined: 18 Mar 2022

Re: What is this capacitor up to? - RC6502

Post by Paganini »

Since the original Apple doesn't have that capacitor, and it seems like it might only be there because of something to do with Arduino, which I'm not using, I think I might just leave it out. There are no pullup resistors, so whatever's going on must be managed by software.
"The key is not to let the hardware sense any fear." - Radical Brad
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: What is this capacitor up to? - RC6502

Post by BillO »

Quote:
What is this capacitor up to?
More than anything it seems to be confusing everyone here.

Sorry I can't be of more help.
Bill
Post Reply