CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

!Help! RS232 OERR ERRORS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ccarty



Joined: 20 Apr 2004
Posts: 2

View user's profile Send private message

!Help! RS232 OERR ERRORS
PostPosted: Tue Apr 20, 2004 11:59 am     Reply with quote

Crying or Very sad I am using the #USE RS232 pre-processor directive as follows.
#use rs232(baud=9600,xmit=PIN_B2,rcv=PIN_B1,bits=8,parity=N,errors)
This is on a pic16f648A, using the hardware usart.

My question is:

When errors is added as an option, are both framing and overun errors cleared automatically?

I think that I have been able to create an OERR and it does not appear that it was cleared.

Thanks for your help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 20, 2004 12:05 pm     Reply with quote

What is your version of the compiler ?

Look at this thread in the archives. If you have the same
problem, you may have to email CCS for a solution.
http://www.ccsinfo.com/forum/viewtopic.php?t=17251&highlight=16f648a
ccarty



Joined: 20 Apr 2004
Posts: 2

View user's profile Send private message

PostPosted: Tue Apr 20, 2004 1:16 pm     Reply with quote

PCM compiler version 3.184 ........the project compiles fine. I am questioning whether or not the OERR error is cleared automatically or if I need to check/clear it manually.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 20, 2004 1:34 pm     Reply with quote

I did a test compile with PCM vs. 3.184 for the 16F648A, and it
does generate code for the hardware USART. So that's OK.

Here is the generated code for the CCS library routine "getch".
It shows that they do check the OERR bit, and if it's set, they
clear it by toggling the CREN bit (per the data sheet).

Code:
0004:  BTFSS  PIR1.5
0005:  GOTO   004
0006:  MOVF   RCSTA,W
0007:  MOVWF  rs232_errors
0008:  MOVF   RCREG,W
0009:  MOVWF  @78
000A:  BTFSS  rs232_errors.1    // Test the OERR bit
000B:  GOTO   00E
000C:  BCF    RCSTA.4           // If OERR = 1, then toggle CREN
000D:  BSF    RCSTA.4
000E:  NOP
000F:  BCF    PCLATH.3
0010:  GOTO   020 (RETURN)
Guest








PostPosted: Tue Apr 20, 2004 1:41 pm     Reply with quote

thanks for your help...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group