Hello All!
i, like many others, have a serin/serout problem, and after much research i have manged to get through 80% of it.
So i am planing on using my 16f688 PIC as an LCD driver and be able to communicate any other PIC to it via serial communication. (so i won't have to connect 6 cables to the pic anytime i want to use the LCD). I am using a 16 char by 2 line LCD
So far I have the serial communication working and am able to talk to the LCDDriverPic from any other PIC. The problem is how to determine the amount of characters i recieve from the pic.
for example on the transmitter side i have:
serout SerialOut, mode, ["LCD", $FE, 1, "transmit", CR]
i am transmitting at 2400 baud, sends "LCD" to initialize LCDDriver, and then sends the LCD commands, which in this case is $FE, 1, "transmit"
on the reciever i have :
serin2 SerialIn, mode, [WAIT("LCD"), testHEX, testHEX2, STR testSTR\16\CR]
I am receiving at 2400 baud, it will wait for "LCD" and receive the data. the string testSTR will receive 16 characters.
when i do this my LCD will display "transmit" (GOOD!!!) BUT will fill the remaining 8 slots with random characters (BAD).
so i need to know if there is a way of determining the last leter of a string sent or something that gives me an indication that its done transmitting so the receiving side won't fill the remaining characters with random. attached is a sample code that i have and works (except for the random characters issue)
thank you all in advanced!
Bookmarks