Page 1 of 1
how to implement FLOWCODE rs232 parity bit on pic
Posted: Sat Mar 22, 2008 12:34 am
by ivan
HI team
I need to send some data by using "9600 8 E 1"
parity "even"(I'm using 16f628a for send some data to a bmw intrument cluster)
how you suggest to implement in flowcode by using a simply step?
thanks
Re: how to implement FLOWCODE rs232 parity bit on pic
Posted: Sun Mar 23, 2008 1:18 pm
by Steve
I think you might need to calculate the parity bit yourself and send it as the 9th bit of the message [you'll need to set this bit using a C icon].
Re: how to implement FLOWCODE rs232 parity bit on pic
Posted: Mon Mar 24, 2008 1:01 pm
by ivan
I used this and work perfect for even parity check if someone need
//c icon
set_bit(txsta,TX9); //at program start
and before transmit set B=mydata
after
//c icon
FCV_B=((((((FCV_B)^(((FCV_B)<<4)|((FCV_B)>>4)))+0x41)|0x7C)+2)&0x80);// check if B have parity or not and place result on bit 7 of B
delay_10us(125); //this need to let 9th of prev transmitted byte i've tried witout but byte overlapping on digital analyzer
if test_bit(FCV_Parity,7)
set_bit(txsta,TX9D); // if need parity will be set to 1
else
clear_bit(txsta,TX9D);
Re: how to implement FLOWCODE rs232 parity bit on pic
Posted: Mon Mar 24, 2008 8:48 pm
by Steve
That's great, Ivan. I'm sure that will help some other users. Thanks for posting it.