HOME

Part 5: VIA and UART Testing

Eagle CAD: v1.1A Schematic

 

 

Eagle CAD: v1.1A Board Layout

 

 

Eagle CAD: v1.1A PCB

 

 

Eagle CAD: v1.1A BoM

 

v1.1A board is out for manufacture

 

 

Here is a great cheat sheet on RS232, ASCII, etc...

Overview

The initial v1.0 design used 32KB for ROM and 32KB for RAM at locations $8000 and $0000, respectively.  I/O started at $6000.

 

Power to the SBC was via a 5v miniUSB connector. Typical current draw is under 100mA.

 

The 20 x 4 LCD (2004A) was driven by a W65c22 VIA (versatile interface adaptor) with data/control starting at $6000 (ACIA UART was added at $7000.)

 

To accommodate the W65c51 ACIA UART communication chip, I changed the v1.0 PCB design to v1.1A

The long expansion connector was moved to the bottom of the PCB for troubleshooting or monitoring with an Arduino ATMega2560.

 

In the final design (at a much later date), board edge connectors (PC or Eurocard) will be added so that the boards may be stacked in a backplane with onboard power.

 

Communication to the UART was via TeraTerm PC terminal software.

 

The WDC ACIA has a hardware bug that the vendor refuses to fix; they insist you add a delay routine between when the TDRE Send Flag asserts and when you actually send the data. Sad... so sad.

 

ACIA UART Test Code

This simple v1.0 test code (written for ACIA with an address base of $6000) will output a "Press any key():" message, then reads a character from the receive buffer 0x6000 and sends it to the transmit buffer 0x6000. So whatever you type in your PC's terminal program (example Tera Term v4.1) should appear on your screen.

If you're using an oscilloscope you should see the Start Bit followed by the 8 character bits and Stop bit; try it with a capital "U" which has a hex pattern of 55 or 01010101 in binary.

For testing purposes, you may notice that I disabled the RX checking routine as well as the delay routine.

 

Here is the Arduino Mega 2560 Logic Analyzer code created by Ben Eater.

Here is the Arduino Mega 2560 Logic Analyzer code I used for troubleshooting the VIA.

Here is the latest Arduino Mega 2560 Logic Analyzer code I used for troubleshooting the ACIA.

 

ACIA Trouble:

Here is the file, ACIA_Message-Keypress_7_1200baud.zip,  I used for troubleshooting the ACIA. It contains the following:

- Arduino Logic Analyzer code (_MegaLA_MessageKeyPress2.ino)

- Screenshot of terminal emulator showing the "Press" message (ACIA_Message-Keypress_7_1200baud.png)

- The 6502 assembler code (ACIA_Message-Keypress_7_1200baud.asm) that was burned to ROM (ACIA_Message-Keypress_7_1200baud.bin) as well as expanded by OshonSoft's 6502 emulator so we have a .lst file to follow the flow (ACIA_Message-Keypress_7_1200baud.lst)

- An annotated Arduino Logic Analyzer capture (ACIA_Message-Keypress_7_1200baud.txt) of the reboot of the 6502, the terminal emulation printing of the "Press" message, as well as the user trying unsuccessfully to type the letter "P" and have it appear on the terminal emulator's screen. This file will be VERY helpful to you in following the flow.

 

Note that v1.0 of the SBC was used with the VIA disconnected. The ACIA was set for address $6000.

 

In the logic analyzer capture, search for  text "6001" after the "Press any key(s):" message completes and you should find the data "10". We're looking for "08" indicating a byte is in the receive buffer ready to be transmitted but we never see it.

 

Modern CMOS Parts Used:

 - CPU: W65C02S

 - VIA: W65C22

 - ACIA: W65C51N

 - ROM: SST39SF040

 - RAM: AS6C4008

 - LCD: 2004A

 - MONITOR: Keye Studio ATMega2560

 

                                   

 

Updated 2023-02-06

 

TOP

 

HOME