View previous topic :: View next topic |
Author |
Message |
hemasc_
Joined: 01 Aug 2012 Posts: 15 Location: Brazil
|
Change serial parity |
Posted: Sat Jun 29, 2013 2:11 pm |
|
|
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
|
|
|
hemasc_
Joined: 01 Aug 2012 Posts: 15 Location: Brazil
|
|
Posted: Fri Jul 19, 2013 12:48 pm |
|
|
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);
} |
|
|
|
|
|
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
|