Thank you for the info Henrik.
I used my pic as a Command Line Editor to communicate from my PC Hyperterminal with many Devices. In the past i did care only for debuging those devices so i never went into trouble looking "why the HECK" those two Bytes pop up into my array and as a result to my Hyperterminal.I thought HSERIN flushed the buffer first thing - apparently not
Since i have to make a more stable program with many "Command Messages" comming via SMS i tried to debug those two Bytes.
After a lot of search and testing the result was that Hserin [Str Arrayvar\n\c] saves the string until the "c" char received but it doesn't clear the RCREGx after so if Hserin is used again, the last 2 Bytes that remain in the RCREGx become the 2 first received Bytes !
I believe RCREGx is both Readable/Writable register because all the codes bellow worked fine.
Code:WHILE RC1IF Dummy = RCREG1 WENDCode:Dummy = RCREG1 Dummy = RCREG1Code:RCREG1= 0 RCREG1= 0
Best Regards, Kostas.




Bookmarks