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

Change serial parity

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



Joined: 01 Aug 2012
Posts: 15
Location: Brazil

View user's profile Send private message Visit poster's website

Change serial parity
PostPosted: Sat Jun 29, 2013 2:11 pm     Reply with quote

Hi!

I'm developing a device that the user has the option to change the serial parity.
There is the possibility that I do change the parity among the firmware?

For example:
Code:

if(true)   #use rs232(baud=9600, parity=O,stop=1,xmit=PIN_C6,rcv=PIN_C7,bits=8, errors)    
else      #use rs232(baud=9600, parity=E,stop=1,xmit=PIN_C6,rcv=PIN_C7,bits=8, errors)


But I need to change only parity!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 30, 2013 12:00 am     Reply with quote

See Ttelmah's reply here:
http://www.ccsinfo.com/forum/viewtopic.php?t=36699

See Tomi's parity routine here:
http://www.ccsinfo.com/forum/viewtopic.php?t=3234
hemasc_



Joined: 01 Aug 2012
Posts: 15
Location: Brazil

View user's profile Send private message Visit poster's website

PostPosted: Fri Jul 19, 2013 12:48 pm     Reply with quote

SOLVED

Code:
#locate RCSTA = 0xFAC
#locate TXSTA = 0xFAB

#use rs232(baud=9600,xmit=pin_c6,rcv=pin_c7,errors,stream=COMM_1,enable=PIN_B1)

if(bit_with_parity)
{
bit_set(TXSTA,6);
bit_set(RCSTA,6);
}
else
{
bit_clear(TXSTA,6);
bit_clear(RCSTA,6);
}
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