jpiat / arduino

113 stars 70 forks source link

Adding parity #11

Closed mranno9 closed 8 years ago

mranno9 commented 8 years ago

Hi, I added a parity bit to the sent data, between the 8bit data and STOP and made the word length 11 instead of 10. (START - 8bit data - 1bit parity- STOP) I know the data is sent correctly, but i have trouble receiving it. I tried modifying is_a_word(), but I can't seem to separate the parity bit. Also, the STX probably isn't received, as you can see in the picture. p Could you show me how to modify the receiver code to separate the parity bit? Thanks a lot for your reply...

jpiat commented 8 years ago

To integrate parity to the bits there is quite a lot to be modified on the receiver side. There is the frame format, the start/stop mask and the sync word mask.

define START_SYMBOL 0x02

define STOP_SYMBOL 0x01

define START_STOP_MASK ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP

define SYNC_SYMBOL_MANCHESTER (0x6665)