SPI Sharing

Adafruit recently announced an LCD “backpack” that has decoders for SPI and I2C communications between an Arduino and an LCD display.  As is their policy, they open sourced their modified LCD library and made the schematic available.  The SPI portion of the device uses only a single 74HC595 eight bit serial to parallel chip, which I happened to have a few of.  So I decided to try sharing the SPI buss between the MCP2515 and a liquid crystal display.  This means I can add a display to one of the nodes by using only one additional pin on the Arduino.  With the help of Adafruit’s example code (and a very similar entry in the Arduino playground) I have a 16×2 LCD breadboarded using pin 9 as slave select for the ‘595 chip.

Arduino breadboard with SPI liquid crystal

Arduino breadboard with SPI liquid crystal

In this photo there are only five wires connecting the Nano to the CAN chip and the LCD.

Adafruit’s library can turn the LCD backlight on and off also, so you can blink the display to draw attention.  This particular LCD doesn’t have a backlight though.  Also I commented out all the I2C stuff in the library and saved 1k of memory.

Next step:  cut a PC board with the CAN chips *and* a 74HC595.

Advertisements
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: