Hi,
Changing the FOR-NEXT loop will only change how many times it loops around checking the RCIFlag and therefor the total time it spends waitng for it - not how often it checks it or how many bytes per second that is sent or received.
For 115200 baud you must check the RCIFlag at least once every ~170us so, like I showed you earlier:
Code:
For TempWd = 0 to 10000
If RCIF then GOSUB Term_Rx
PauseUs 100 '<----Note PauseUs, as in Pause micro seconds...
Next
Goto Main
This will check the RCIFlag every 100us and it will do it 10000 times, so all in all it will wait one second, if no data is received it'll jump to Main.
If you by, the LCD stops updating, mean that the data written to the LCD by the main program in the PIC it's because once the PIC sees the initial RCIF caused by the the "Q" beeing received the main code stops and jumps to your receive routines. It then stays there untill you return to the main program so the LCD can't update....
Code:
RX_Bombed:
TimeoutCount = TimeOutCount + 1
end select
Goto Term_Rx
Here, you probably don't want to jump back to Term_Tx but instead jump back to either your main program or RETURN depending on how you got to the routine in the first place. That should prevent the PIC from locking up. And you can remove the TeimOutCount thing, that was for my tests....
You need to implement some form of handshaking when the user presses Update in the application, simmilar to when the app is first started. The PC can't just dump data into the PIC since your application may be off doing something else and miss it. (Since you're not using interrupts).
Take a pen a piece of paper, think it thru.
/Henrik.
Bookmarks