I’ll put it to you this way, I don’t think you have any choice but to communicate between the two controllers in some fashion
If any one controller prints the entire display of both values, then one value has to be communicated from one controller to the other.
If you want both values displayed on the LCD at the same time, the only way to achieve that without one controller knowing what the other is thinking,
is to print half of the display with one controller, and the other half of the display with the other, but to do that, to some extent,
one controller still has to know what the other is thinkingat the very least so they don’t try to print a the same time.
To do that you only need to use the shared LCD Enable pin.
Whenever a controller is not printing, the Enable pin is an input listening for highs on the Enable pin from the other controller.
Whenever a controller wants to print, so long as the enable has not been held high by the other controller for a duration
it can go ahead and print it’s line, by setting the Enable pin output, then high, then set the rest of the LCD data/control pins,
then send Enable low to latch the LCD data, and continue till the line is printed, then set Enable as an input again.
If one controller wants to print, but notices the other is printing because the Enable pin has been set high by the other controller
within a duration (the duration being a little longer than it takes to print a line to the LCD), it simply waits until the Enable pin
has been low for the duration before having a go at printing it’s data. That way neither controller is a master or a slave,
so long as each leaves a significant delay because there’s an awareness that it’s no the only controller trying to use the LCD.
At least that’s first way I wouldn’t go about not doing any of that.
This all assumes that the LCD data latches on the transition of the Enable pin from high to low,
and it’s the transition from low to high that is ignored (which is the way I remember it),
but I’m writing for a library currently, and haven’t had to deal with that for some time.





Bookmarks