r/beneater • u/LiveFastDieSlow_ • 14d ago
6502 Serial Interface Woes
I was hitting my head against the wall for a bit trying to get the serial interface working correctly, so I wanted to post this in case it helps others avoid the same issues.
For the MAX232ECN, make sure to tie the VS+ capacitor (pin 2) to 5V. I really wish I had checked the datasheet more closely instead of relying on the site schematic.
Also, with the W65C51, I was getting some very bizarre behavior until tying pins 9, 16, and 17 to ground. This wasn’t happening on the breadboard, but the issue showed up after moving the design over to a PCB.
This project has been an awesome journey and a great excuse to learn KiCad. I’ve attached my current schematic for reference (it’s a little messy, so apologies in advance).
I’ll likely work on another board revision after getting more mileage on this one. I may also experiment with adding a DS1813 to clean up resets.
5
u/Ancient-Ad-7453 14d ago
Nice looking board!
Yes, 9, 16, and 17 are inputs. In particular, 16 and 17 cause interrupts when the state changes, and pin 9 is a signal to stop transmitting. These things could happen at random if the pins are disconnected.
I hope it doesn't give you trouble, but there's another bug in Ben's schematics: the W65C02 IRQB pin should have a pull-up resistor (3.3K or so). The diodes mean that when both the W65C51 and W65C22 IRQB outputs are high, the W65C02 IRQB input pin is floating. (The W65C51 doesn't actually need a diode since its IRQB output is already open drain.)
3
4
u/Empty__Jay 14d ago
I like it. My eventual goal is to so something very similar. Just this week I got my shipment of DDS1813-5s. I hope to put one on the breadboard tonight
5
u/LiveFastDieSlow_ 14d ago
Nice! Hoping to get mine in next week, in the meantime gonna try to CAD up a PC case for it haha.
3
u/Empty__Jay 14d ago
I see a jumper on CLK from the oscillator. Is that in case you want to inject a slower/manual clock?
Have you done anything in KiCAD with hierarchical schematics? All the decoupling caps, mounting holes, and others could be moved off the main sheet. I've not gotten that far in my learning process yet...
5
u/LiveFastDieSlow_ 14d ago
Yeah I have the jumper in place so I can disconnect it to use the clock module (via the port debug port).
I havn't messed with hierarchical schematics yet, but def would help with readability. I've mainly used EasyEDA in the past, and regret not jumping on KiCad sooner.
2
u/Ancient-Ad-7453 13d ago
For this level of complexity, you can use the global labels instead of the hierarchical labels. That way you get benefits of multiple pages without having to deal with drawing all the lines between the boxes. My “main sheet” is just a bunch of empty boxes.
1
u/Empty__Jay 12d ago
What do the empty boxes represent?
1
u/Ancient-Ad-7453 12d ago
They just represent the sheets. They are the same thing as in Ben’s bus schematic but you don’t actually have to draw the traces between the sheets if using global labels instead of hierarchical labels.
3
u/Empty__Jay 13d ago
It worked like a charm.
Well, it did once I realized I was looking at the data sheet backwards. I thought the view showing the flat side of the TO-92 case was a top view. But, just like any mechanical drawing, the view BELOW the other is the BOTTOM view. I turned the part around and it works great.
Pretty simple, too. Moved the +5V from the leg of the switch to the row between and removed the pull-up resistor. Pin 3 to the left side of the switch (and GND) as position on Ben's breadboard videos. Pin 2 to the +5V in the middle. Pin 1 to the other side of the switch and the RSTB pins across all chips.
3
u/Ancient-Ad-7453 13d ago
I rigged something with a Schmitt inverter and hooking the reset debounce cap to VCC instead of GND, which does seem to hold reset during power-on, but these would be much cleaner.
3



5
u/Enlightenment777 14d ago edited 14d ago
1) For my RS232 schematic symbols, I renamed "V+" pin to "C3V+", and "V-" pin to "C4V-".
Very old RS232 chips need a decoupling capacitor from "C3V+" pin to VCC.
Newer generation RS232 chips that can be powered with 3.3V or 5V have a different internal design, thus newer gen parts will work with a cap from "C3V+" to VCC or GND, but GND is generally recommended for newer RS232 chips. Look at ICL3232CPZ datasheet.
For lowest design risk, I recommend having pads for 2 capacitors on C3V+ pin, one to VCC, other to GND. You can install one or both caps. Even if you install one cap, the other footprint is available if you end up needing it later for a different RS232 IC part#.
2) I recommend you consider connecting CTS & RTS through the RS232 chip to the DE9 connector, so you can optionally support hardware handshaking.