My aim is to connect a 4x20 LCD from Modtronix (LCD2S) to an Arduino. With respect to writing code, which is the simpler code to learn/implement. I2C or SPI? To a novice, they both look a little overwhelming.
Has anyone used this display? It would be great to learn what pins are on the Arduino are required and to tap into some sample code.
It appears the Modtronix LCD2S that I intend to use only operates with I2C or SPI. If I use I2C, do I need to connect the I2C Interrupt line?
If I go down the I2C path, I connect SDA to pin 4 of the Arduino, SCL connect to pin 5, (+5V and GND). Do I need the Interrupt line? So far the sample code I can find doesn't refer to the Interrupt. Any suggestions?
What does the manual say the display uses the interrupt for?
For an application that just writes to the display I wouldn't
think you would need it but I am not sure.
The SDA is on Analog pin 4. The SCL is on Analog pin 5. I don't have an
Arduino so I am not sure of the Arduino pin numbers
I did think of a downside to I2C on an 168/328 -- you lose two analog inputs
I believe I2C is slower. IIRC it has a maximum rate of 400KHz.
Hmm - I guess you're right; not sure what I was thinking:
It looks like I am going to have to do more research on both of these; it seems my comment on SPI needing a pin for each slave device for select usage may be incorrect (?)...not sure now.
it seems my comment on SPI needing a pin for each slave device for select usage may be incorrect (?)...not sure now.
All of the SPI devices I have seen require one pin to select. You place the SCLK,
MOSI, MISO lines of all devices in parallel and enable one device at a time.
Since input and output are on separate lines an SPI device that requires both input
and output needs four line per device. For these devices I2C saves two
lines.
I've actually written code to interface with the Modtronix LCD2S via I2C on the Sanguino. Should work on the Arduino. The relevant code is in the ModtronixLCD2S.[ch] and AsyncTwi.[ch] files in the zip file at http://www.belfry.com/code/SanguinoMaster-LCD.zip