Serial Out/In

sodeaf

Senior Member
Hey guys, another simple question. I have written a very long program with a ton on LCD commands (Serout) as you all know it takes a ton of memory. I have a read up a bit on adding eprom chips and such but it seems a little more technical then what I am used to. I have gotten comfortable using the SerOut to my LCD and was wondering the following. If I write my program on one 18M2 and use a 2nd 18m2 for LCD information can I just use the Serout on the program ic and serin on the lcd (2nd M2 chip) Could I not just use serout N2400_4 (1) and if my LCD M2 is waiting for a serin command it would see (1) and put the "1" in variable "A" then the program will continue and complete "1" instruction? Is it as simple as that or am I out to lunch. I wanna to try this but before I do if anyone has any input it would be great. I'm using Logicator to write the program.
 

hippy

Ex-Staff (retired)
What you suggest, if I understand it right, should work. The second 18M2 can receive the "1" and send data to the actual LCD while the first 18M2 gets on with doing somthing else.

The only thing to ensure is that the second 18M2 has completed sending to the LCD and is executing another SERIN before the first issues another SEROUT. If the SEROUT is issued too soon it's like asking a secretary to do something while they are off doing something else you already asked them to do and the second request will be missed.
 

sodeaf

Senior Member
Thanks Hippy,

Yeah what I was thinking was the "Main Start" on the 2nd M2 just have the serin and loop. Then a "start1" which would keep checking for variable change, and if there is a change it would follow that rung and complete the command then start back checking to see if the variable had changed from that point again. This way I could use all the memory in the 2nd 18M2 strictly for the LCD screen. Variable = "X" do xxx an so on. So where I have all my Serout's in my main page which are directed to the LCD right now I will change to a simple variable and send that to the 2nd M2 which will then send the correct date to the LCD based on the variable change. I will not need any feedback from the 2nd M2 to the first. This way the first M2 which is the critical program wont get locked up waiting for "Serin". Do I need to use a resistor between the Ser Out/in pin between the 2 chips or connect direct? Pull them High? Low?

Thanks again
 

hippy

Ex-Staff (retired)
Unfortunately SERIN will block until it receives a character and no tasks ( Start1:, Start2 etc ) will run until it receives data. However, you can combine your main program SERIN with the LCD program as a single program and that will work.
 
Top