Instead, try:This version will send only the target temperatures.
It should send "S" followed by carriage return
Then it should send 12 digits (4 sensors * 3 digits) followed by carriage return
It should then wait 3 seconds to give you time to process stuff, then it will query everything and expect all 108 characters back.
It will then wait 4 seconds, and display what it received
Then in your main loop add something like:It should send "S"(single character, no carriage return)
It should wait for the PIC to reply with "K" (or your favorite acknowledge character)
Then it should send 12 digits (4 sensors * 3 digits) followed by carriage return
It should then wait 3 seconds to give you time to process stuff, then it will query everything and expect all 108 characters back.
It will then wait 4 seconds, and display what it received
nTest var byte
I suspect the PIC appears to lock because it misses a byte. The above slows everything just a little and uses a positive acknowledgement to make sure everything is set.Code:If PIR1.5 = 1 Then 'check to see if there is data in the serial buffer HSERIN[nTest] if nTest = "S" then HSEROUT["K"] 'Let the PC know to start sending data HSERIN[....all the rest of your stuff...] endif endif
Hope this helps somehow...
Best Regards,
Paul




Bookmarks