S100 Computers

HomeS-100 Boards HistoryNew BoardsSoftwareBoards For Sale
ForumOther Web SitesNewsIndex   
 Under Construction
Please come back later
The Arduino ATMEGA 328 & 2560 CPU Board
Introduction

A whole world of new hobbyists have in the past decade grown up around the "Arduino" boards.  Arduino is an open source computer hardware and software (Italian) company that designs and manufactures CPU board kits for the control objects. The project's products are distributed as open-source hardware and software. Arduino boards are available commercially in preassembled form, or as do-it-yourself kits. Arduino board designs use a variety of microprocessors. They are usually equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The microcontrollers are typically programmed using a serial communications interfaces, including (USB) on some models. Programming is often C or C++. Arduino also provides a nice integrated development environment (IDE) for writing simple "sketch" code.  Two very popular boards are the Arduino "UNO" board and "MEGA".
  
  UNO Picture   Mega Picture
 
By far the most popular "Shields" pinout is that found on the UNO.  The MEGA is somewhat similar but has more I/O pins. See here for a pinout diagram for the UNO pinout and here for a pinout diagram of the Arduino MEGA board.

In order to use and understand this S100 bus Atmega 328/2560 CPU board you should be fairly familiar with the Arduino hardware and software.
Excellent vendors with much information about Arduino boards are "SparkFun.COM" and "Adfruit.COM" and of course Arduino itself.

Please note: this board can be driven by either the Atmega 328 or Atmega 2560 CPU chip but not both CPU's at the same time.  The first thing you have to decide is which CPU you would like the board to be setup and configured for.  Because the Atmega 2560 CPU is a surface mount chip, once it is installed on the board there is no way of going back to using the 328 CPU (without desoldering the 2560 chip from the board).  It is however possible to start with a 328/UNO configuration and later remove that chip and go to a 2568/MEGA configuration.  Because of the large number of pin connections/jumpers that would be required you cannot go back from a MEGA to UNO setup.  That said,  the UNO setup is simpler to configure, if you mainly wish to use Arduino Shields you might just stick with that setup.  For maximum flexibility you might consider building two boards.

We will build a board based on the Arduino UNO board first and then later reconfigure it for the MEGA 2560 CPU as well.  This board utilizes the ATMEGA 328 CPU. The Atmega328 has 32K of flash program memory and 2K of Internal SRAM. It is a 28 pin DIP chip.  It has 14 digital I/O pins, of which 6 can be used as PWM outputs and 6 analog input pins. These I/O pins account for 20 of the pins. Here is the pinout for the Atmega328.
  
     Arduino 328 Pinout

The chip takes a 16 MHz Oscillator and runs at 3.3V or 5V, (we will use 5V).   We will work with this (simple) CPU and use it to interface I/O ports and interrupts on the S100 bus as well as interfacing with Arduino "Shields".  The trick with this few CPU I/O pins will be to have a very flexible pin jumpers arrangement.
Here is a summary of the boards layout.
    
    Board Diagram
 
You can see that unlike for example our Edison CPU boards, we are not running this board in an S100 bus Master/Slave arrangement. There are simply too few available CPU pins to do so. The board will appear to the S100 bus as a set of 8 bit wide I/O ports (user defined), but is also able to trigger S100 bus interrupts.


Step By Step Building the Arduino ATMEGA 238/2560 CPU Board.
The build instructions are fairly simple for this board. As always, first examine the bare board carefully for scratches or damaged traces, use a magnifying glass if need be.  A broken trace is almost impossible to detect by eye on a completed board..

Build the board up in functional steps. Avoid the temptation of adding everything at once and popping it into your S-100 box. Step by step is faster in the end -- trust me.  We will set the board up as an S100 bus I/O board. 
Here is a picture of the bare board:-        
  Bare Board

Solder in all the required IC sockets, resistors, resistor arrays, capacitors, jumpers, and the 3.3V and 5V voltage regulator.  For the latter you can use a 7805+heatsink approach (e.g... Jameco # 9246333, a L7805CV), or you can use more modern switcher regulators such as thee Pololu # 28500(5V, 2.5A) or EzSBC.com # PSU5aa(5V 2.5A). In most situations you will not need the 3.3V regulator. 

Do not add the LED's yet. Be sure you put the resistor arrays in with the correct orientation of pin 1. Check their values before soldering (they are difficult to remove).  Insert all jumper arrays. For prototype boards I typically use common Aluminum Electrolytic caps. For the final board I use the corresponding Tantalum caps.  There are two sockets for the RV1 (10K Pot). Use whichever best suites the actual variable Pot you get.
   
For prototype boards I generally use "double swipe" IC sockets. For a critical board like this I prefer to use "Machine Tooled" IC sockets.  However they are more expensive and you have to be particularly careful not to bend the IC pins.     For the specialized mini boards such as the Serial to USB adaptor, the 16X2 LCD display and the Micro SD card adaptor you have a choice of directly soldering the units to the board or using a single row socket such as the
Jameco socket #308567 (cut to size). The former yields a nicer board but removal is difficult.  In some cases however the board plated through holes are so tight you can first test the unit before soldering.    For prototype boards I always use sockets.

Place the board in the bus. Check the voltage to sockets on the board is about 5V by placing the board in your S-100 system using an extender board. With no load you will typically get 5.00V  (+/- 0.2V).  While not used in the construction below, check that the U13 regulator is putting out 3.3V to pin 3 of K8.  BTW, your system should boot and run correctly with its Z80 master CPU board. If not, you have a serious solder bridge somewhere on the board.  Before you do anything else with a magnifying glass go over every socket on the board and examine for proper solder joints. I like to "reheat" each joint just to be on the safe side. The silk screen/varnish on these boards us quite thick. It's easy not to have a good solder joint for the ground pins.  Double check.   Extra time here will save you hours later.  

Next insert all
4 LED's. Before soldering them in place ground the appropriate LED pin to be sure it lights up.  

Here is a picture of the board at this stage.
   Step 0

Arduino Bootloader
If you don't already have the Arduino IDE software writing/uploading program on your PC you need to do that now.  It's best to upload it from the Arduino web site itself (https://www.arduino.cc/en/Main/Software).  Here is what it looks like:-
   
  IDE Interface

The Atmega 328 (and 2560) CPU chips as manufactured in the factory come as "virgin" chips. They must first have their onboard ROM programmed to accept an Arduino "bootloader" to allow the uploading of an actual Arduino "sketch" program.  This requires an Atmega programmer.  Fortunately the hardware & software is very standard and there are a number of cheap USB drive programmers on the web.  Personally I found the best/easiest method is to use an actual Arduino UNO board and special cable described here.  This has the advantage that it works for both the 328 and 2560 chips -- some don't.  The Arduino script file
"Atmega_Board_Programmer.ino" is provided at the bottom of this page.  Follow the instructions described here, but use the Atmega_Board_Programmer.ino file provided -- it has been edited to also allow the burning of both the 328 and 2560 CPU chips (see below). Be sure to select 328 for the current CPU in the Arduino IDE.  Check your UNO board is recognized. You should see something like this under Tools/Board Info.:
   
   
     Programming IDE
 
Insert a "virgin" Atmega 328 chip in the socket marked U9 on the S100 board.
Next we need to connect up the ICSP port (P25) for programming.
Jumper P49 pin 12 to P9 pin 6, jumper P49 pin 10 to P9 pin 2 and jumper P49 pin 8 to P9 pin 4. (see the picture below).

Open the serial monitor connection in the above Arduino IDE (top RHS button).   Make sure it is set for 115200 baud.
Hookup the UNO board and S100 board as shown below.
Note the S100 boards is NOT in the S100 bus. The UNO board provides all the power that is needed.
Compile and run the above sketch file.  Here is a picture of the setup.    
      UNO Bootloader

Follow the instructions in the Arduino Serial monitor.
 
    IDE Bootloader

If you are new to the Arduino world you may want to start off with a ATMEGA 328 CPU already pre-programmed with the Arduino bootloader code in the chips ROM.  These are more expensive that the virgin Atmel CPU chips but can be obtained from a number of sources (e.g.. Adfruit for $5.95).   However pre-programmed 2560 CPUs are not available.

To check our uploaded is working correctly we will use it to upload a simple Arduino Sketch test file
BLINK_328.UNO using the boards USB port.  However first we need to activate a USB port on the board so we can pass software to the 328 CPU over this port (pins 2 & 3 of the CPU).

The  SERIAL to USB Adaptor   
There are numerous "chips" available for this function. We will use the Sparkfun unit. Its simple to use and the Arduino software works directly with it.
  
USB Adaptor
  
Insert the SparkFun FT231x Serial to USB adaptor in P28.
Insert U5.  Jumper
P41, 4-5,  P47, 4-5 and K5, 2-3.
Jumper P32,5 to P36,6 and P32,6 11-12 to connect up the two LEDs D2 and D3 to pins 3 and 4 of the 328 CPU.

Hook a USB cable from the SparkFun FT231x to your PC's USB port. Within the Arduino IDE "
Tools Menu", assign the USB port to the Arduino IDE program and set the Arduino board type to UNO.

Copy the
ArduinoFiles.zip file at the bottom of this page across to a directory for access with your Arduino IDE. Extract all the .UNO files into a "Arduino S100 Programs" folder and load BLINK_328.INO.  Compile and upload this "sketch" program.  Please note the compile process is actually fairly slow for the first time a sketch file is loaded (~1 minute).  During the upload the LED's on the FT231x board should flash.  Also the D4 LED should light up.  If this does not happen you probably either have an invalid boot loader or a bad USB port connection.  If you have a Genuine Arduino UNO board get that board working first.

If the
BLINK_328.INO program worked the LEDs D3 & D2 should blink.  If not you can check your software/hardware with a genuine Arduino UNO board. Upload the BLINK_328.INO program to that unit and check that the boards shields "Pins 2 & 3" pulsed high/low continuously.  You can use a resistor/LED as a probe.

This brings me to one problem I find with these Arduino Boards. Arduino provides convenient jumpers on their boards for connection to breadboards or to utilize custom plug-in "Arduino Shield" boards which plug in and sit on top of the Arduino CPU board.  By far is the most common jumper arrangement is the UNO jumpers arrangement.
  
  Shields Pinout

So for our
BLINK_328.INO,  we will connect the  LED to Shield pin 2.  This pin is designated as "2" in the Arduino software library. It is actually connected to pin 4 on the 328 CPU chip.  The library pin names for the UNO board is shown above.  Unfortunately (for reasons that are not clear to me), the pin arrangement and library names are not the same or a sub-set of the larger array of pins available for the Arduino MEGA 2568 CPU board.  The MEGA 2568 board as we shall see have a different pin/library arrangement.  That said, anything you can do/program on the UNO can easily be reassigned/programmed for the MEGA board.   

This does however complicate our board layout.  I have retained the "lowest common denominator", the  UNO board pin layout for the UNO shields sockets but added jumpers so that essentially any MEGA CPU pin can be utilized to drive them. While the actual shields sockets retain the UNO configuration/spacing pin designations, the schematic refers to the Arduino MEGA 2560 pin names.  This actually sounds more complicated than it is.  If you make a printout of this
328 and 2568 pinout sheet you should not have a problem.  In all your sketch programs use the "IDE" names but jumper the sockets based on the "real" CPU pin numbers.
 
You must get the above
BLINK_328.INO program working before going further.

LCD Display using the 328 CPU
Next we will get the 16X2 line LCD display working.  This fairly common display can be obtained for example from Adfruit for $10.  While others are available, this HD44780 16X2 LCD display already has an Arduino library written to interact with it and so is easy to get going immediately.
           
Insert the display in its P6 socket. Add the 10K Pot RV1 (normally supplied with the LCD display).
For our 328 CPU we will drive the display with the CPU pins
14,15,6,11,12 & 13 (PB0,PB1, PD4-PB7). This corresponds to library pins 8, 9, 7, 6, 5 & 4.
So jumper P51, 1-2, 3-4, 5-6, 7-8, 9-10 & 11-12 and to the LCD display P12 1-2, 3-4, 5-6, 7-8, 9-10 & 11-12.
Compile and upload the
LCD1_328.INO file:-

#include <LiquidCrystal.h>
#include <EEPROM.h>
#include <SD.h>
#include <SPI.h>                                         // required for Arduino >= 1.5.4

LiquidCrystal lcd(8, 9, 7, 6, 5, 4);                     // CPU pins 14, 15, 6, 11, 12, 13 (PB0, PB1, PD7, PD6, PD5, PD4 of CPU)
                                                         // PB0, PB1, PH4, PH3, PE3, PG5 on schematic
int x = 0;
                                                         // the setup function runs once when you press reset or power the board
void setup() {                                           // initialize digital pin LED_BUILTIN as an output.
pinMode(S100_WRITE, OUTPUT);
pinMode(S100_READ, OUTPUT);                              // set up the LCD's number of columns and rows:

lcd.begin(16,2);
lcd.clear();
lcd.print("LCD Initilized.");
lcd.setCursor(0,2);
lcd.print(FreeRam(),DEC);
lcd.print(" XBytes free");
}

void loop() {                                             // the loop function runs over and over again forever
digitalWrite(S100_READ, LOW);
delay(100);
digitalWrite(S100_WRITE, HIGH);
delay(100);
digitalWrite(S100_READ, HIGH);
delay(100);
digitalWrite(S100_WRITE, LOW);
delay(100);

lcd.clear();
lcd.setCursor(0,0);
lcd.print(FreeRam(),DEC);
lcd.print(" Bytes free");
lcd.setCursor(0,1);
lcd.print("Count = ");
lcd.print(x++,DEC);
}

We will use this LCD display to issue diagnostic information about the board to us as we progress further.
Here is a picture of the board at this stage:-
   
  Step1
     

SD Card Interface using the 328 CPU
Next we will add the Micro SD card adaptor. This is where Arduino really shines, the complex process of writing code to interface with a MSDOS file system using a simple 8 bit CPU is already done for us.  Also helpful,  companies Adfruit supply a Adfruit MicroSD adaptor which it has a built in 3.3V to 5V level converter so we can directly splice the unit into our board. (SD cards only run at 3.3V).  The above site also has a detailed instruction list of how to interface and use the unit.
  
  MicroSD card
 
Remember, SD cards are 'raw' storage. They're just sectors in a flash chip, there's no structure that you have to use. For the Arduino library we'll be discussing, and nearly every other SD library, the card must be formatted FAT16 or FAT32. With the Arduino SD library can use either.

First format your card on your PC, start with a FAT16 format.

Because SD cards require a lot of data transfer, they will give the best performance when connected up to the hardware SPI pins on the 328 or 2560 CPU. These hardware SPI pins are much faster than 'bit-banging' the interface code using another set of pins. For 'classic' Arduino such as the Uno those pins are digital
13 (SCK), 12 (MISO) and 11 (MOSI) in the Arduino library. (These correspond to the actual 328 CPU pins 19,18 & 17).  You will also need a fourth pin for the 'chip/slave select' (SS) line. Traditionally this is library pin 10 (CPU pin 16,but you can actually use any pin you like). For the Arduino Mega 2560 as we will see later,  the pins are different!

Insert the SD adaptor in connector P7. With this arrangement the MicroSD card is now connected to the 328 CPU pins (
19,18, 17 & 16).  No jumpers are required.  Here is a picture of the board at this stage:
  Step2
Insert a MicroSD card.  The D1 LED should go off.

We will test our card with 3 simple sketch programs derived from the Arduino IDE "CardInfo" examples. However before we test the card we need to do one thing with the Arduino IDE.   Again launch the  handy serial terminal interface with the boards USB port.  Set its Baud rate to
115200 (bottom middle button).

Now compile and upload
SDCardInfo_328.INO within the Arduino IDE. You should see something like this in the "Serial TTY window".  It gives you information about your MicroSD card  -- all for a few lines of code!
  
    SD Card Info
 
  
The core Sketch code is:-

Serial.print("\nInitializing SD card...");
pinMode(10, OUTPUT);
                                        // we'll use the initialization code from the utility libraries
                                        // since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
        Serial.println("initialization failed. Things to check:");
        Serial.println("* is a card inserted?");
        Serial.println("* is your wiring correct?");
        Serial.println("* did you change the chipSelect pin to match your shield or module?");
        return;
        } else {
        Serial.println("Wiring is correct and a card is present.");
}

                                         // print the type of card
Serial.print("\nCard type: ");
switch (card.type()) {
        case SD_CARD_TYPE_SD1:
                 Serial.println("SD1");
                 break;
        case SD_CARD_TYPE_SD2:
                 Serial.println("SD2");
                 break;
        case SD_CARD_TYPE_SDHC:
                 Serial.println("SDHC");
                 break;
        default:
                 Serial.println("Unknown");
}


Next we will setup and write to a file TEST1.TXT some keyboard characters. Now compile and upload SDCardWrite_328.INONO. You should see something like this in the "Serial TTY window".
    
    SDCard Write
  
Next we will open the file TEST1.TXT and display its contents.  Now compile and upload SDCardRead_328.INO. You should see something like this in the "Serial TTY window". 
       
    SD  Card Rd
 
The core Sketch code is:-
 
myFile = SD.open("test.txt");

if (myFile) {
Serial.println("Reading from file:- test.txt ......");
while(myFile.available()){
      Serial.write(myFile.read());
}
myFile.close();
Serial.println("Reading complete. File closed");
}
else Serial.println("Error opening file test,txt");
}

Please note this is a very simple example of the use of the Arduino SD library to use a MicroSD card. The SD library is quite extensive, SD Card functions are listed here.

S100 Bus IO
Utilizing the 328 CPU section of the board to read/write to an S100 bus I/O port is very limited because of the few pins available on the 328 CPU. Normally we would have to either disable the SD Card or LCD display or process only a few data bits.  (It is possible to temporally inactivate the SD card or LCD display and get the full 8 bits but I have not played around with that approach).  If you do so and develop some useful S100 bus related sketches I will be delighted to post them here.  The current board as configured is really setup to use the 328 CPU with Arduino Shields. For an S100 bus interface I will therefor illustrate only two very simple examples.

The first will be to input a data bit from an S100 bus port.  We will input and display on the LCD display (in real time) the status of
bit 0 from I/O port 80H on the S100 bus.
Insert the IC's U7, IC1, U16, U6, U8, U5, U1, U12 & U11.
Insert the two dip switches SW5 & SW6. Set all switches to closed,  except the LHS switch of SW5.
Jumper K1 2-3.
Jumper P31-4 to P32-6 and Jumper P31-5 to P32-4.
Jumper P13-14 to P33-6.
Jumper P35-2 to P33-1.
Jumper P13-8 to P33-2.                                                                  
      Step3
 Now compile and upload S100_Port_Wr_328.ino within the Arduino IDE. You should see something like this on the LCD display.
  
    Port Write Data

Here is the relevant sketch code.

void setup() {
pinMode(READ_LED, OUTPUT);
pinMode(WRITE_LED, OUTPUT);
pinMode(READ_DATA0_READY, INPUT);
pinMode(READ_S100_DATA0, OUTPUT);
pinMode(S100_DATA_BIT0, INPUT);

lcd.clear();
lcd.print("LCD Initilized.");
lcd.setCursor(0,2);
lcd.print(" Read 80H bit 0");
delay(1000);

digitalWrite(READ_S100_DATA0, LOW);     // Clear the FF
digitalWrite(READ_S100_DATA0, HIGH);
}


void loop() {
bool x;
lcd.clear();
if (digitalRead(READ_DATA0_READY))
      {
      digitalWrite(READ_S100_DATA0, LOW);       // Activate OE* on the 74LS374
      x = digitalRead(S100_DATA_BIT0);
      digitalWrite(READ_S100_DATA0, HIGH);     
      }


digitalWrite(READ_LED, !x);
lcd.print("80H = XXXXXXX");
lcd.print(x);
delay(1000);
}

When we use the Z80 Monitor command to output to the port 80H the value of its bit 0 will be displayed.
U
se QO01  or QOFF.

If the above did not work follow the signals with a logic probe. On the S100 bus side outputting to port 80H must pulse high pin  11 of U11. Pin 1 should pulse low with each 328 read, follow the CPU pins/jumpers.


Next we will output a data bit to an S100 bus port.  We will output and display a high and low value for
bit 0 for I/O port 80H on the S100 bus. 
Leave the jumpers P31-4 to P32-6 and Jumper P31-5 to P32-4 as the were.
Add Jumper P13-16 to P33-5.
Change Jumper P35-2 to P33-1 -> P34-2 to P33-1.
Change Jumper P13-8 to P33-2 -> P13-6 to P33-3.          
Here is a picture of the board at this stage
 
   Step4
Compile and upload S100_Port_Wr_328.ino within the Arduino IDE. On your S100 Z80 Monitor you should see something like this:-
  
      328WR_a                328 WRb
 
The Arduino is flipping the bit 0 data bit of port 80h each time it is assayed by the S100 bus Z80.  Here is the relevant code

void loop() {
digitalWrite(WRITE_LED, HIGH);
   if((bool)digitalRead(S100_DATA0_BUSY))
      {
      lcd.setCursor(0,0);
      lcd.print("BUSY = HIGH ");
      lcd.setCursor(0,2);
      lcd.print("Read Port 80H ");
      }
   else
      {
      lcd.clear();
      lcd.print("BUSY = LOW ");
      if(x == HIGH)
           {
           digitalWrite(S100_DATA_BIT0, LOW);        // Latch and hold data bit
           lcd.setCursor(0,2);
           lcd.print("80H = XXXXXXX1 ");
           x = LOW;
           }
       else
           {
           digitalWrite(S100_DATA_BIT0, HIGH);       // Latch and hold data bit
           lcd.setCursor(0,2);
           lcd.print("80H = XXXXXXX0 ");
           x = HIGH;
           }
   digitalWrite(WRITE_S100_DATA0, HIGH);             // Reset the FF
   digitalWrite(WRITE_S100_DATA0, LOW);
   digitalWrite(WRITE_LED, LOW);
   delay(1000);
   }
}
 
Apologies to our more experienced programmers for the verbose code -- wanted to keep things easy for beginners.

There are definitely much more sophisticated things you can do with this 328 CPU on this board with your S100 bus system.  There is a decent size "patch area" to add your own chips. The number or available GPIO pins is however a limitation with this  CPU.  It's not as bad as you might initially think because one could multiplex 2 or 3 CPU GPIO pins with say a 74LS138 and have a workable number. Also the SD card is only active when CS* is low, and once a program is loaded it sits in the CPU EEPROM and so the USB port pins are no longer needed. 

Nevertheless the main function of this board is to use it with the 100 pin Atmel 2560  8 bit, 20MHz, CPU.  The only downside is the 2560 CPU is a surface mount chip.  Once you place it on the board there is no going back to the 328 CPU chip.   Early on I considered jumpers for the 2560 CPU to allow both CPU's.  The overall layout was way too complex and confusing.  As it is the board jumper layout is somewhat confusing!   The problem is Arduino uses different pin names on their UNO and MEGA boards.   On this board the default pin name is for the Arduino MEGA board.  You absolutely will need to have before you the pin designations for the UNO and MEGA boards before you to get UNO programs working correctly.


The MEGA 2560 CPU Board
First remove the 328 CPU chip and all wire jumpers from the board.  From this point on we will not be able to use the 328 CPU again. Carefully solder in the MEGA 2560 CPU chip. Please note that pin 1 is facing the top right position of the board  (unlike all other chips on this board).   Note where pin 1 is on the chip in the picture below. Its in the corner with the small indent circle. The Atmel label is sideways.
 
To solder in SMD chips like this you will need a very fine pointed soldering iron.  Cover the pad area with plenty of solder flux, then cover all the pads on the board with solder so it "bulges" on each pad but does not cross to the neighboring pad.   Be absolutely sure of this, use a magnifying glass. The pads on this board are far larger than the CPU pins so its easy to solder then down.  Place the chip on the board such that all pins are exactly at the center of each pad.  Briefly touch the end of pin one with your soldering iron holding he chip in place with your finger. The underlying solder will melt and fuse to the pin.  Check the chip alignment, using a blade to reorientate the chip if necessary,  (desolder if required). When completely satisfied touch the tip of pin 50 with the soldering iron..  Again check all pins are correctly positioned.  Then go around the chip briefly touching the end of each pin. Check each pin is soldered by gently trying to move then with a fine blade between the pins. Retouch if necessary.  Remove the excess flux with flux remover.  You are done!  I have found that these chips stand quite a bit of heat abuse  -- unlike some SMD video chips.  Before going further do a very careful inspection of every pin around the chip.

Just as we did above we need to burn in an Arduino bootloader.  With the 328 CPU removed the same P25 socket and jumpers can be used.  However we do need to also jumper  P9 1-2, 3-4, and 5-6.  Again follow the instructions described here, but use the
same Atmega_Board_Programmer.ino file (bottom of this page) -- it has been edited to also allow the burning of both the 328 and 2560 CPU chips (see below).  Be sure to select 2560 for the CPU this time.  Here is a close up picture of the connection:-
   
     2560 Bootloader   Bootloader Output

Make sure you get a "No errors found" return in the Serial Terminal feedback.

Next we will repeat the above steps we did for the 328 CPU to check our bootloader is fine. 
Again we will test it with BLINK_2560.INO.

For the SparkFun FT231x Serial to USB adaptor in P28,  the jumpers P41, 4-5,  P47, 4-5 and K5, 1-2 do not need to be changed. 
Jumper P32 pin 6 (PG5), to P31 pin 6
Jumper P32 pin 5 (PE5)  to P31 pin 4.

Check the USB cable from the SparkFun FT231x to your PC's USB port has the correct COM port. Within the Arduino IDE "Tools Menu", set the Arduino board type to MEGA 2560.

Compile and upload the "sketch" BLINK_2560.INO program.  During the upload the LED's on the FT231x board should flash.  Also the D4 LED should light up.  If this does not happen you probably either have an invalid boot loader or a bad USB port connection. 

If the BLINK_2560.INO program worked the LEDs D3 & D2 should blink.  If not and you have a genuine Arduino MEGA 2560 upload the BLINK2560.INO program to that unit and check that the boards shields "Pins" 3 & 4 pulsed high/low continuously.  You can use a resistor/LED as a probe.   Here is a picture of the board at this stage.
     Step 5
   
xxxxxxxxxxxxxxxxxxxxxx

LCD Display Using the MEGA 2560 CPU
With that working and our bootloader OK, now lets get the LCD display working.
With the display still in its P6 socket, for our 2560 CPU we will drive the display with the CPU pins
37-42 (PL2,PL7, PL3-PL6).
So for
P49 remove all the jumpers.  For P12 jumper 1-2, 3-4, 5-6, 7-8, 9-10 & 11-12.
Compile and upload the LCD2.UNO file:-

xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx


We will use this LCD display to issue diagnostic information about the board to us as we progress further.
Here is a picture of the board at this stage:-
   
   
  

SD Card Interface using the MEGA 2560 CPU

Next we will use the Micro SD card adaptor with our MEGA 2560 CPU. Check the SD adaptor in Connect P7.
With this arrangement the MicroSD card needs to be connected to the 2560 CPU pins (19,-22). 
The required jumpers are 
P9 1-2, 3-4, 5-6 & 7-8, (PB0-PB3).  The first 3 jumpers are already in place.
Here is a picture of the board at this stage:
   
   

Insert a MicroSD card.  The D1 LED should go off.

Again we will test our card with 3 simple sketch programs derived from the Arduino IDE "SD Card" examples.
Again we launch the Arduino IDE serial terminal interface with the boards USB port.  It's Baud rate should still be 115200.

This time the hardware pins
19-22 are the Arduino sketch library pins are 50-53 so we need to compile and upload SDCardInfo2.UNO.
You should then see the same information in the "Serial TTY window" we saw above.

Likewise to read and write to the
TEST1.TXT file on the Micro SD card run SDCardWrite2.UNO and SDCardRead2.UNO.


S100 Bus IO with the MEGA 2560 CPU
Unlike the situation with the 328 CPU there are many more available GPIO pins to interface with the S100 bus with the 2560 CPU.  Please examine the
board's schematic at the bottom of this page.  There are two ways S100 bus ports are addressed on this board. Either hardwired using the dip switches SW5 and SW6 or by programming the 2560 itself.  Lets start with the simplest case, the hardwired setup.  The port address can be 8 or 16 bits.  We will assume (here) the upper 8 bits are zero and the port address is 80H by jumpering K1 2-3.

Insert all IC's on to the board except U1, U11, U12, U15 and U16. 
Configure SW5 and SW6 for port 0080H. Here is a picture.
   
  
   
    
We will hookup the eight S100 bus data in pins to the 2560 CPU pins
78-71 (PA0-PA7) by jumpering all the pins in P35 (1-2.....15-16).
When the S100 bus writes to port 80H it will set the
S100_DATA0_READY pin on U14A.  
This is routed to Pin 8 of P13 and via a jumper to
P13 pin 7 it will end up on the PD0 pin 43 of the CPU.
Boot up your Z80 monitor and send the value 33H  to port 80H

QO80,33

Check pin 11 of U11 pulses low.  If it does not determine why.
Next insert the 74LS374 in U11.
Now compile and upload S100_READ1.UNO. 
Again from your Z80 monitor

QO80,33

The LCD display on the board should display 33H as shown here:
      
   
  
Again if you do not see this value back trace with a logic probe and determine why.
Here is a picture of the board at this stage:
  
   
   
 

A Production S-100 Board
Realizing that a number of people might want to utilize a board like this together with a group of people on the  Google Groups S100Computers Forum, a "group purchases" was done. This process is now closed. If you would like such a board please keep an eye on the forum for when another run is done.  Do not contact me directly.


The links below will contain the most recent schematic of this board.
Note, it may change over time and some IC part or pin numbers may not correlate exactly with the text in the article above.

BURN.UNO.ZIP
ArduinoFiles.zip
BUS DISPLAY BOARD SCHEMATIC     (FINAL V1.2   2/14/2017)

BUS DISPLAY BOARD KiCAD Files     (FINAL V1.2  1/25/2017)                
BUS DISPLAY BOARD Gerber Files     (FINAL V1.2  2/14/2017)
BUS DISPLAY BOARD BOM.PDF             (FINAL V1.2   1/25/2017)   (Supplied by Rick Bromagem)
BUS DISPLAY BOARD BOM.XLS               (FINAL V1.2   1/25/2017)   (Supplied by Rick Bromagem)




Other pages describing my S-100 hardware and software.
Please click here to continue...

 

This page was last modified on 04/23/2018