Two Picaxe to one LCD

pyrogaz

Member
We have a 40X2 based speed controller for an electric car which also sends several variables to a serial LCD and an Openlog datalogger. We now wish to add a GPS module but the 40X2 is already very busy and we don't want to slow down its control of the critical processes it runs. The idea is to use a 20X2 to to receive the GPS sentence using Hserin, extract the relevant data then send it to the existing LCD and datalogger. In effect the serial out pins of the two picaxe chips would be in parallel.

If we use a small signal diode on the output pin of each picaxe is there any reason why this shouldn't work? Both will be sending about once per second but for the majority of time they won't coincide, there will be occasional clashes but would this cause anything worse than corrupted data?
 

Technical

Technical Support
Staff member
It would probably be better to send the 40X2 data to the 20X2 (received via serin) and then have the 20X2 do all the writes to the LCD.
 

BeanieBots

Moderator
I'd also suggest what Technical have said.
One of the problems with LCD displays is that when they get something they don't like (corrupt data) they have a habbit of locking up and need to be reset. Sometimes resetting can actually require a full power cycle before they will respond again. The 20X2 will be far more likely to cope with clashes and keep the LCD happy.
 

mikie_121

Member
Am I to assume you're using a serial LCD?
If so why not just send a 'write' pin high while either of the chips is writing to the LCD, and before writing to the LCD check that line. If it's high then the other chip is busy, if it's not then send it high and write away.
If it's not a serial LCD then it should still work, as long as only one chip initialises the LCD and you keep strict control over where the cursor is.
 

Dippy

Moderator
I'd take the advice by technical too.

I didn't quite follow what mikie was describing but unless you are using some hardware then shared I/O must ALWAYS be able to tri-state input when not in use (i.e. go into 'input' / high impedance mode).
Two pins in (TRIS) output mode joined could end in tears and the receiver would receive crap in any event.
 

pyrogaz

Member
We followed Technical's advice and now have the 20X2 receiving GPS data via hserin, it then takes data from the 40X2 using serin, processes everything and sends to LCD and datalogger.

The added benefit is the 40X2 no longer needs to process data into a suitable format for display, this must have been taking a significant amount of time as the throttle response is now noticably faster and acceleration ramps much smoother.
 
Top