Guys I'm receiving AT commands from a GSM modem & reading it from a PIC 16F628A.
The problem is the receiving buffer gets stuck when receiving responses from GSM modem.
After adding the OERR bit test loop the problem solved.
I need to know where is the best place to place this error check in code? For now I placed them in the main loop.Is it ok?
What about placing in the ISR?
Do I also need to check framing errors as well?
The problem is the receiving buffer gets stuck when receiving responses from GSM modem.
After adding the OERR bit test loop the problem solved.
I need to know where is the best place to place this error check in code? For now I placed them in the main loop.Is it ok?
What about placing in the ISR?
Do I also need to check framing errors as well?
Code:
org 0x0004
ISR_Enter ----
----
btfss PIR1,RCIF
goto ISR_Exit
movf RCREG,W ; save the new character
movwf RC_Buffer
----
----
ISR_Exit
Main_Loop btfss RCSTA,OERR ;check for overun errors
goto Continue_Main
movf RCREG,W ; reset OERR
movf RCREG,W
bcf RCSTA,CREN
bsf RCSTA,CREN