PDA

View Full Version : 2 Pics, 1 Serial LCD



Armadus
- 30th January 2008, 14:03
I have a circuit that uses 2 Microchip PIC18F242 chips, programmed with PicBasic Pro. I would like to use a single serial LCD controlled by each of the chips. (See attached diagram).

The program from the first PIC sends: Serout LCD, ON9600, [poscmd, 64, "Battery Voltage"]
After a 1 second pause the program from the second PIC sends: Serout LCD, ON9600, [poscmd, 104, "OK"]

The "Battery Voltage" message appears as expected, but when the second program is sent the screen goes blank.

Note: I tried using N9600, and the first message appeared as expected, but the second message displayed, but not as expected.

The LCD displays the message from either individual chip correctly, when the other chip is not in the circuit.

Any suggestions?

skimask
- 30th January 2008, 14:11
I have a circuit that uses 2 Microchip PIC18F242 chips, programmed with PicBasic Pro. I would like to use a single serial LCD controlled by each of the chips. (See attached diagram).
The program from the first PIC sends: Serout LCD, ON9600, [poscmd, 64, "Battery Voltage"]
After a 1 second pause the program from the second PIC sends: Serout LCD, ON9600, [poscmd, 104, "OK"]
The "Battery Voltage" message appears as expected, but when the second program is sent the screen goes blank.
Note: I tried using N9600, and the first message appeared as expected, but the second message displayed, but not as expected.
The LCD displays the message from either individual chip correctly, when the other chip is not in the circuit.
Any suggestions?

After each SEROUT command, set the respective PICs pin to an input so it won't mess with the line between the two.

Serout LCD, ON9600, blah blah blah
INPUT LCD

mister_e
- 30th January 2008, 20:14
As long as there's no collision.. Skimask's suggestion has to work. For sanity i would use an extra I/O on each PIC to know if the LCD is available or not. Still possible to plug the LCD on one PIC, and send the data from the first to the second one. The second one will monitor the whole thing.

Armadus
- 31st January 2008, 14:04
By changing the pins to inputs after the Serial out commmand the circuit works very well.
For this application there is not a problem with timming the two signals, so for this time I do not need the monitor, but it is an idea that I may use in the future.

Thanks.