The plan is to implement the UART as it often is, interfaced to a serial port. Since my last post I have had to re-wire all of my work, and I have moved from EAGLE to KiCAD since it is open-source, and I find it a bit more user-friendly. I also have new USB->Serial cable thanks to Rat Shack going out-of-business! This time we will try out an echo program. Type characters into a terminal emulator on a PC, and they will go through the USB->Serial port to the Z80 circuit. The character will then be read into a register, and echoed back to the PC to finally show up in the terminal emulator program. Sounds easy right?
Well yeah with the know how of before it was fairly easy to get this up and running. Wired everything up. Basically assembled the program in the previous post with a minor modification. Powered the circuit up, ran the echo program. You can type things on the PC’s keyboard and see them on the terminal emulator program. Whats the catch? Well when I type the character ‘w’ or ‘_’ or ‘o’ other characters echo back sometimes. Why is this? Well after much debugging and probing and asking people on forums I am leaning toward a timing issue caused by driving the UART directly from the Z80 control signals without any decoding logic to introduce propagation delay. The data bus gets latched at the wrong timing and you get garbage characters back.
Since the reliability is very high (I only have problems with the characters ‘w’ ‘o’ and ‘_’) I don’t think I am going to debug much further. In this situation if I got this far it is highly unlikely that there is any major mistake that would prevent me from expanding on my design. Although even with this small test I only have one section on my breadboard left to add things in.
What I am mostly worried about with my implementation is the modem control signals on the UART. I don’t use any hardware control for my serial port. I tried to implement RTS/CTS, but in PuTTy, with the hardware flow option selected, the circuit just doesn’t respond. I also tried to implement DTR/DSR, but it doesn’t seem to solve my above problem, so I am leaving it out for now for simplicity. I am absolutely clueless as to what to do with the remaining control signals, so I left the outputs unconnected, and the inputs tied to either VCC or GND based off of if they were active-high or active-low to ‘disable’ them.
Before thinking about PCBs I need to run some tests with RAM in the system to make sure I am squared away with a stack so I can finally use calls, rets, pushes, and pops.
Next time around I will be adding both memory and I/O decoding logic to handle chip selects and reading and writing.
All Files from this project can be downloaded from my GitHub Repository,