I have a small dilemma. I am starting a MIDI sequencer project that will hook up to my microKorg synthesizer. It will use two ATmega168 microcontrollers; one for handling output, and one for handling input. The 'output' one will be hooked up to some LEDs, HC595 IC's to control more LEDs, and the MIDI IN on the synth. The 'input' micro will be hooked up to a pot, a wii nunchuck, and possibly some buttons. Rx on the 'output' or master controller will be hooked up to the Tx on the 'input' or slave microcontroller. The slave micro's Rx lead will be hooked up to the MIDI OUT jack. I need to also have an LCD in this project. The problem is, how do I get a serial LCD display to communicate with the master microcontroller if the Tx lead is already hooked up to the MIDI IN? Will I have to resort to the parallel interface on the LCD to do this, or does that requite the Tx and/or Rx pins to be used as well? :-?
well.. my two suggestions for you are: Use a Softserial Library - than you can define as many RXs and TXs as you want. That is imho the best available solution for you.
Then as second suggestion i would use a LCD which is based on an HD44780 display just because there are multiple codes available to run these LCDs on either 4 pins OR on just 2 analog ones (using an I2C port expander).
Ok. Well, since I didn't know what a soft serial library is, I just looked it up. It seems a little complex to say the least.
As for my LCD, it DOES have a HD44780 micro built in, so I'm set for parallel communication. It just happens to also have a serial 'backpack' on it as well. So what kind of pins will I need to communicate with the LCD via parallel communication? As long as I don't need to use the Rx/Tx lines, I'm good. I am also going to be short on pins; that's why I am wondering which I'll need to use (analog or digital). I also don't know what a I2C port expander is lol. It is also to my knowledge that if I go with the parallel interface instead of using the serial 'backpack', I get better manipulation of the pixels on the LCD (instead of being able to just print symbols, numbers, and text, I can make custom characters, right?). How easy would you say it is to use this method with the pre-made arduino 'liquidcrystal' library?
quackmaster, have a look a NewSoftSerial library here http://sundial.org/arduino/index.php/newsoftserial/
Its easy to use
#include <NewSoftSerial.h>
// An LCD connected to pins 7 and 8, use whatever pins you want
NewSoftSerial LCD(8,7); // output pin 7 goes to serial LCD (8 is input)
void setup()
{
// set the data rate for the NewSoftSerial port
LCD.begin(9600); // or whatever baud rate you need for the serial port
}
void loop()
{
LCD.print("Heloo World");
}
The file is here: http://sundial.org/arduino/NewSoftSerial/NewSoftSerial7.zip