serial interface

The next thing that I would like to do is to add a way for the computer to be able to communicate with another computer and vice versa. We can split communication interfaces into serial and parallel. I have chosen serial as I would like to design an interface that corresponds to the RS232 protocol. There are many serial protocols but I chose RS232 as it is of the era (it has been around since 1960) and although the interface has been dropped from modern computers, there are lots of devices around that use it and there are some modern devices (such as embedded) that use it!

RS232

The RS232 standard has gone through a number of revisions, with the last happening in 1997. For RS232 to work correctly, both devices must know the transmission speed, the number of data bits, the number of stop bits and if a parity bit has been used. RS232 was so ubiquitous that it was often referred to as ‘the serial port!’ Originally it was used to connect a computer to a modem.

Each part of the signal is either low or high, which is dedicated by the voltage level. The standard states that a low level must be in the range of 3 – 15V and a high as -15 to -3V.

PINDESCRIPTION
1CD (Carrier Detect)
2RXD (Receive Data)
3TXD (Transmit Data)
4DTR (Data Terminal Ready)
5GND (System Ground)
6DSR (Data Set Ready)
7RTS (Request to Send)
8CTS (Clear to Send)
9RI (Ring Inicator)
9 pin D SUB pinout

Direct communication with the computer from another computer would be helpful for debugging, viewing the contents of RAM and writing programs directly into the RAM! I would send data by using a shell connection, a program that I can run on a computer and use to communicate with my 6502 computer.

When designing a serial interface I need to decide on which form of data transmission to use. The two most common ones are direct memory access (DMA) and programmed input-output (PIO). One big difference between them is that DMA does not involve the CPU, PIO does! The consequence of this is that DMA is faster than PIO and allows the CPU to do the other jobs that it needs to. However, this advantage would be most noticeable with large data transfers and I believe that PIO will be adequate for my system.

The way that I plan on achieving this is by using a 6551 in my design. The 6551 is an Asynchronous Communications Interface Adapter (ACIA). I will need a crystal. Built-in baud rate generator. The 6551 is of the era. It was used in the Commodore PET and Plus/4. It could be done without 6551 but the CPU couldn’t do anything while receiving data! Use specialist hardware.

We need to run an application on the computer that will communicate with the 6502 computer, to allow information to be sent between the two. There are a number of these available. On my computer, I already have an application called PuTTY that I use for various scenarios (such as connecting to a Raspberry Pi), that can be used for the task. This application supports many network protocols but the important thing is that it can connect to a serial port.

I need to design and make a TTL to RS232 converter.

Type into a terminal program and the computer receives what I type. I want a bi-directional serial interface. The computer has a 5V supply but I need + and – 10V to transmit RS232. Charge pump to create necessary voltages. -3V to -25V (logic 1) and +3V to +25V (logic 0). Need to convert from TTL level to RS232 level and vice versa. -3V to +3V undefined. The level needs to be changed so that it can be understood by both computers but also so that the higher voltages don’t damage any circuitry! 6551 logic 0 is -0.3V to 0.8V and logic 1 is 2V to Vcc.

Need external crystal to obtain different baud rates.

I now have the necessary transmit and receive signals coming from the 6551 but it cannot be used to connect to a computer yet! There is a problem, the voltages from the ICs in the computer are TTL level but RS232 requires both negative and positive voltages for logic 0 and 1! What I now need to do is to create a circuit that provides level translation in both directions! This means that it needs to provide TTL to RS232 and RS232 to TTL conversion.

Need to do level conversion and translation.