News:

;) This forum is the property of Proton software developers

Main Menu

3 Pic to drive 1 lcd?

Started by Maxi, Jan 12, 2023, 06:28 AM

Previous topic - Next topic

Maxi

hello guys
how is possible to drive "one lcd" with 3 pic controller?
is it possible and have any body any idea?
(4x20 HD44780 std character lcd)

Teo


RGV250

Hi Maxi,
I have done it but not quite how I think you want to do it.
When I was doing my CAN network I had one dedicated device acting as a collector controlling the screen and showing the data from another 6 nodes.
You could use RS232 (TTL) or RS485 to get the data to your collector device?

Bob

Stephen Moss

For a start, how it could be done would depend on whether your LDC has Parallel, serial or both inputs and whether or not certain PICs are responsible for data on specific lines of the display, i.e. PIC 1 = Line 1 & 2 Data, PIC 3 = Line 3 Data, PIC 4 = Line 4 data, or if all three PICs are writing to all 4 lines.
If the latter then you have to include delays between each PIC writing otherwise data from one PIC may be over written by that from another before it can be read.

Parallel would be possible, assuming you want each PIC to communicate directly to the display you could try using Tristate bus drivers to isolate the data from each PIC to the display and a method of enabling the outputs of the respective buffer at the appropriate time.
Alternatively, you could try wire ORing by changing the I/O states of the Data, EN & RS pins of each PIC from Output when transmitting to Input when not transmitting to avoid contention on the lines. If the display will tolerate logic low up to 0.4V using pull up resistors a Schottky diodes to achieve the same thing maybe a little more robust as it provides better isolation between the I/O pins of each PIC, although you would have to invert the Data, EN & RS signals doing it that way.
You would also need a way of preventing the multiple PIC's from trying to use the bus at the same time, such as one PIC sending a busy signal to the others which is checked before they attempt transmission.

Serial transmission maybe better, as depending on the type of bus used there may be an inherent a way to detect when the bus is busy before attempting transmission, for example on an SPI bus each PIC could check to see if another has pulled the Select line low as an indicator that the bus is busy.

Or as Bob said use one PIC as a master that both drive the display and receives data to be displayed from the other two PICs


See_Mos

#4
I gave incorrect information.

See tumbleweed's post below

tumbleweed

I wouldn't try to do this directly in hardware, no matter if it's a serial or parallel display. The electrical interface is one thing, but you would need to have a method of having each controller request use of the display and relinquish it back when done.

Displays require a number of transactions to do something, during which it can't be used by another process.
Imagine what would happen if you were in the middle of sending a command string to the display and a second controller jumped in and sent something too... command gets changed, position gets changed, etc.

joesaliba

I would wire the LCD to one PIC, which will be the master, then, you send a request to slave 1, send data and print it, then request from slave 2, print it and then print from the master.

All you need is two, 16 byte array for line 1 and line 2, fill the array and print the arrays.

Regards

Joe

See_Mos

That's a neat solution Joe.

In addition to the LCD the master would only need three additional pins. The slaves would only need two pins each, leaving an additional four pins on each slave to use for other purposes and the software would be quite easy.

My solution was far more complex.

Maxi

Quote from: Teo on Jan 12, 2023, 07:07 AMHi.
but why ?
Teo
one or two times I need before
Im sure many people need it
(not mostly but sometime realy need in project)

Im happy listen your ideas
thank you

joesaliba

Maxi,

I have a project, 80% finished, but have the serial going strong. I communicate to a Nextion display, and needed to communicate with other 3 serial devices, so that's a total of 4 serial devices. The PIC I am using, 16F1827, only have a single hardware USART. I could have opted two toggle pins to use USART on different pins, but I needed 4.

I used a 74HC4052 multiplexer and that did the job. Select two pins to drive from where you need communication and that's it. Now in your case you can have one master and four slaves!

In your case, your serials will be your slave PIC's.

If you go that route, Positron manual says to not rush things when doing serial. Do step by step and make sure it works.




trastikata

Quote from: Maxi on Jan 12, 2023, 06:28 AMhow is possible to drive "one lcd" with 3 pic controller?

If you don't need to read anything from the LCD, use gate logic to buffer all the lines - OR-Gate (4075 for example) for the active-high lines and NOR-gate (4025 for example) for the active-low lines.

Dedicate another MCU pin as an input to check if the LCD is busy receiving data or 2 MCU pins and an OR-gate if you really need the MCU's to see each-others activity.