6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 7:29 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sun Mar 20, 2022 4:56 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
Can anyone explain what this capacitor is doing here?

Attachment:
20220320_121749.jpg
20220320_121749.jpg [ 3.08 MiB | Viewed 859 times ]


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


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 6:09 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
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:
File comment: clip from apple 1 schematic
apple-1-serial-pia.png
apple-1-serial-pia.png [ 41.33 KiB | Viewed 848 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 6:37 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
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


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 7:15 pm 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 136
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.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 7:26 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 8:47 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
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


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 20, 2022 11:03 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 21, 2022 12:03 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1928
Location: Sacramento, CA, USA
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)


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 21, 2022 9:30 am 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 298
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 22, 2022 12:35 am 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
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


Top
 Profile  
Reply with quote  
PostPosted: Wed May 11, 2022 9:28 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1001
Location: Canada
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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: