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
how to implement FLOWCODE rs232 parity bit on pic
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: how to implement FLOWCODE rs232 parity bit on pic
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
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);
//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);