Skip to content

Arduino Compatability

The major arduino compatibility feature of the Olduino is the headers that allow attachment of some arduino shields. I’ve been able to use these headers to support a variety of shields including a seeed studio ethernet shield and sd card shield, a colour LCD shield, and a couple of different prototype shields. The major limitations are uni-directional I/O pins, and fixed SPI parameters.

The picture below shows the Arduino headers with a breakout of the connections to the 1802.
14-08-27 arduino compat

The 1802 has an 8 bit parallel output port addressed as OUT 4. Parallel Out 0 to 7 are connected to what would be Digital pins D3 to D10. I chose these to avoid D0 and D1 which are the UART pins of an arduino and D2 which is INT0 and might reasonably be expected to be an input. It also includes D10 which is the default slave select pin for SPI peripherals.

The SPI subsystem consists of an output shift register(Master Output Shift Register) addressed as OUT 6 and an input(Master Input Shift Register) addressed as IN 6. These connect to arduino digital 11 and 12 respectively which are also referred to as MOSI and MISO when used for SPI. The SPI clock on arduino digital pin 13 is one of the few pins that is actually attached to the onboard AVR. The AVR gets a wakeup call when the 1802 writes to MOSR and generates the required 8 clock cycles at 3.5 MHz. The SPI system can only do mode 0 and is fixed at the 3.5 MHz speed but I haven’t found that to be a big limitation. An arduino though, is fast enough that it can comfortably bit-bang SPI on any of its pins so it’s not unusual to see SPI peripherals attached to different pins. For example, the colour LCD shield has an SD card on the dedicated SPI pins and the LCD connected to separate pins for bit-bang output.

The 1802 does not have access to a specific parallel input port but I’ve connected the flag inputs /EF1 to /EF4 to what would be four of the analog inputs. Again, this hasn’t been a problem yet. I also connected the 1802’s Q output to what would be Analog 5 just because it was handy.

All of an arduino’s pins are bi-directional and none of the olduino’s are. The only circuit where I’ve dealt with that so far is for the ultrasonic sensor. That has a single signal wire which is initially an output from the micro but is also an output from the sensor. The sensor expects a brief positive pulse on the pin and, a ms or so later it seizes the pin and holds it high for a duration equivalent to the flight time at the speed of sound to the nearest obstacle. To accommodate this I connected the sensor pin to the Q output through a 10K resistor and to /EF1 directly. The sensor can easily override the Q signal and the /EF1 pin sees the right input.

The AVR’s UART pins are connected to the arduino digital 0 and 1 pins but I haven’t had occasion to use that. The reset position of the header is attached to the AVR reset pin which will in turn reset the 1802.

The schematic below shows the parts of the circuit related to the arduino headers.
14-08-21 part schematic
The AVR shows with three SPI-related clock lines: The main SPI clock that runs to the headers, SR_clock which just clocks the shift register, and /SR_clock which is its inverse. I separated these because I had pins to spare and, where the 1802 is just doing output to the AVR’s serial port, the AVR can clock the shift registers without an external peripheral noticing. Note that the MISO line from the header to MISR has a resistor inline because some peripherals(I’m looking at you, SD card) don’t always release MISO when they should. Reloading the 1802 requires MISO and /EF4 to be available so they are insulated from the rails a bit.

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: