how to implement FLOWCODE rs232 parity bit on pic

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
ivan
Posts: 4
Joined: Thu Feb 14, 2008 12:45 pm
Contact:

how to implement FLOWCODE rs232 parity bit on pic

Post 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

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: how to implement FLOWCODE rs232 parity bit on pic

Post 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].

ivan
Posts: 4
Joined: Thu Feb 14, 2008 12:45 pm
Contact:

Re: how to implement FLOWCODE rs232 parity bit on pic

Post 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);

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: how to implement FLOWCODE rs232 parity bit on pic

Post by Steve »

That's great, Ivan. I'm sure that will help some other users. Thanks for posting it.

Post Reply