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

[SOLVED] Question about RS232_ERRORS

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



Joined: 10 Feb 2011
Posts: 241
Location: Vancouver, BC

View user's profile Send private message

[SOLVED] Question about RS232_ERRORS
PostPosted: Mon Apr 18, 2011 1:14 pm     Reply with quote

Hi There,

How do I know which USART is represented int RS232_ERRORS?
Can't find documentation.
Thanks,
Ron


Last edited by cerr on Mon Apr 18, 2011 3:13 pm; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9253
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 18, 2011 1:54 pm     Reply with quote

open a project..
press F11...ccs onscreen help !
search for #use rs232

read what it says ....
"The definition of the RS232_ERRORS is as follows:



No UART:

· Bit 7 is 9th bit for 9 bit data mode (get and put).

· Bit 6 set to one indicates a put failed in float high mode.



With a UART:

· Used only by get:

· Copy of RCSTA register except:

· Bit 0 is used to indicate a parity error.



Warning:
The PIC UART will shut down on overflow (3 characters received by the hardware with a GETC() call). The "ERRORS" option prevents the shutdown by detecting the condition and resetting the UART.
"

I tend to leave the CCS onscreen help open while in all projects...saves me time loking up 'stuff' like this !
cerr



Joined: 10 Feb 2011
Posts: 241
Location: Vancouver, BC

View user's profile Send private message

PostPosted: Mon Apr 18, 2011 2:24 pm     Reply with quote

Huh,

Thank you! So what's the best approach to determine which USART is carrying an error? It doesn't say if RS232_ERRORS is mirroring RCSTA1 or RCSTA2... The problem i'm experiencing is that I put my RS232 from the PC in BREAK (verified with oscilloscope) but the PIC doesn't see it. My code:
Code:
if (bit_test (RS232_ERRORS, 2)&& ! input (PC_RX)) {

This is on USART1.
Any suggestions? Surprised
cerr



Joined: 10 Feb 2011
Posts: 241
Location: Vancouver, BC

View user's profile Send private message

PostPosted: Mon Apr 18, 2011 3:13 pm     Reply with quote

I'm now just doing it this way round:
Code:
if (bit_test (RCSTA1, 2)&& ! input (PC_RX)) {

Where RCSTA1 is
Code:
#byte RCSTA1 = getenv("sfr:RCSTA1")

That seems to work fine for me.

Thanks,
Ron
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