Friday, 2 June 2023

6502 : AMI : Daughter board

Intro

We set up the ACIA serial interface as an add-on to the Ben Eater board BEN2.  It has proved to be very successful so far, serial download reliability has been very good.
It was originally my intention to develop a new board containing the ACIA; however the current solution seems good enough to proceed further.  On this basis I decided to replace the breadboard with a daughter board AMI which contains the contents of current add-ons.  Principally it includes the ACIA serial interface and the LCD screen.
Adding a 1MHz oscillator and stepdown speeds, some LEDs and buttons would also be useful.  This would enable me to dispense with two breadboards.

Board Design

First step was to review which board type is most appropriate for the daughter board. My first thought was to use breadboard style stripboard so I could just copy my breadboard setup for ACIA and LCD.  However the connections at both ends are not currently simple ribbon cables.

To make connection / disconnection reliable I wanted a header along the top of AMI with all necessary signals from BEN2.  The best option is clearly the same stripboard layout as used for BEN2.  It has 48 columns and 6 rows of 5 connections.  We can use the top row for headers, the second and third rows for ACIA and LCD, leaving some of row four plus rows five and six for the oscillator, LEDs, buttons and any other add-on chips.

As ACIA is the most vital component and the most sensitive I designed it first.  The picture below shows the header for both 6502/ACIA and VIA/LCD along the top.  The ACIA chip is on the left hand side.  Pins on the top row only need a single wire connected.  On the bottom row we have some extra connections for the oscillator.

For flexibility I put a header row below the ACIA so that I can use / monitor ACIA pins.  Also I put header pins on unused top row pins.  In the event that I decide to use hardware flow control I can utilise the ACIA pins using the headers.

My intention is to use a USB cable with FTDI built in so I added a 3-pin header below the ACIA for GND, TX, RX pins.  In future I may mount an FTDI board, so I have roughed out and reserved space for one at the bottom of the boad.

LCD connections to the header on AMI's top edge are simpler.  I added a female header to attach the LCD Panel to.

The partially complete AMI layout, with all connections for ACIA and LCD is shown below.


ACIA Build

The ACIA connections were added to the board first and successfully tested.  


Initial results were very good, in particular the dropping of characters output to the display seems to be reduced / eliminated.  this indicates that using the oscillator on the breadboard was a source of many problems.  Any future use of breadboard oscillators would probably benefit from a little carrier for the oscillator which plugged into the breadboard properly.

LCD, LED, Buttons

Encouraged by the ACIA working properly, I added some LEDs and buttons to the design.  The LCD utilises 3 pins on port A and 8 pins on port B.  That leaves 5 pins on port A I can use for other purposes.  I intend to use pins PA0 and PA1 for buttons and PA2, PA3, PA4 for LEDs.  It is always useful to have these simple inputs and outputs available to programs.  Status LEDs are rather dull but I made them slightly more interesting with Red, Amber and Green.  I also added a blue "power on" LED.  I dont currently have any button programs but they will be useful, particularly for testing interrupts.

Version 2 of the design adds a few components in the centre of the board.  I had to be carful to leave enough space around the buttons.  Although the button itself doesn't take much space, my finger uses a 5 x 5 square of space when pressing it.


I soldered the LCD connections and added LEDs and buttons.  When I had wired up the board  I was most concerned to ensure that the ACIA still worked.  It did continue to work and I was pleased that I could use xmodem to download LED and LCD test programs.

Both LCD and LEDs worked using the test programs so we are making good progress.

Remove Rats Nest Wiring

Of course the purpose of AMI is to replace the breadboard which previously contained ACIA and LCD.  As I started this stage my wiring was becoming quite messy with AMI providing the ACIA and the breadboard still containing LCD + LED.


Now that i have AMI working I can remove the ACIA/LCD breadboard and my computer is beginning to look better:


Clock and other bits

There are a few improvements I wanted to make to AMI.  Firstly, the buttons have no debouncing circuitry.  I added a capacitor across each of them to reduce bouncing - although it is not a complete solution.  I will need to add a debouncing subroutine before I could use buttons for detailed work such as counting.

Next I added a second reset button.  The circuitry is a duplicate of the BEN2 reset button.  It helps to have a reset button more accessible on AMI as the one on BEN2 is sometimes difficult to get right.

Thirdly I should add a clock chip to AMI so that I can dispense with a separate clock board.  Initially I thought I would add a scaling chip so that I can slow down the clock if I want to.  However I decided not to bother as long as I can still use the clock + 2 scalers or the Ben Eater clock if debugging requires it.  To achieve this I have a pin header adjacent to the clock chip.  The clock, clock+scalers or Ben Eater clock can be attached to the 6502 via a wire.


I soldered and tested these modifications but irritatingly BEN2+AMI stopped working when I wired the boards to gether again.   I disconnected all Arduino wires and the board became more reliable but not perfect.
It may be that I can set up the 6502 to flash its own ROM.  If so I potentially dont need the Arduino again.  In addition to flashing ROM its other purpose was to show single stepping, but I rarely need to do that now.

When I tested the clock chip on AMI it didn't work.  I soon found that its GND was soldered in the wrong place and needed to correct this.

Finally I recognised that my FTDI serial connection can power the board so I only need one USB connection from my PC which provides serial communication and power.  To make connections simple I added a 5V post next to the FTDI GND post and connected it to other 5V signals.
I was now able to remove the second "add-on" breadboard leaving BEN2 and AMI working together with only a single external cable required.  This looks a lot better.

Concluding Notes

Our 6502 hardware is now in great shape.  We have two boards containing all the chips we need.  We have terminal i/o and LED/LCD output.  We have a basic working monitor and we can download  executables from a PC to run them.
I am becoming confident that I have a system without the crippling problems of the one which was shelved in 2021 and believe it should become a good basis for further work. 





No comments:

Post a Comment