- Tue Sep 25, 2012 3:03 am
#149802
Hi guys,
So I've been writing my own code (assembly for PIC 16F88) for these little wireless devices.
I have them working great, but I have a small problem.
Currently I'm simply loading two bytes into the payload and transmitting (with 2 byte CRC, enhanced shockburst, 250kbps), then increasing the number and sending again.
The receiver is connected via another 16F88 and the received numbers are sent via software UART to the serial port on my computer.
However very occasionally one of the bytes seem to get corrupted e.g:
But looking at the numbers where this error occurs, it is always just a single bit that has been flipped
For the example above:
168 = 1010 1000
136 = 1000 1000
Is there anything I could do about this? and how does this get past the CRC etc?
I could always fill the 32 byte buffer with numerous copies and only keep the number that occurs most (given that this only occurs rarely), but this seems a little wasteful.
Cheers,
Kane
So I've been writing my own code (assembly for PIC 16F88) for these little wireless devices.
I have them working great, but I have a small problem.
Currently I'm simply loading two bytes into the payload and transmitting (with 2 byte CRC, enhanced shockburst, 250kbps), then increasing the number and sending again.
The receiver is connected via another 16F88 and the received numbers are sent via software UART to the serial port on my computer.
However very occasionally one of the bytes seem to get corrupted e.g:
Code: Select all
Now I don't think it is a problem with the serial code/connection, as if I send the received numbers twice (from the receiver to the serial port) the error is printed twice, indicating that this is how the numbers are received at the receiver.166 166
167 167
136 168
169 169
170 170
But looking at the numbers where this error occurs, it is always just a single bit that has been flipped
For the example above:
168 = 1010 1000
136 = 1000 1000
Is there anything I could do about this? and how does this get past the CRC etc?
I could always fill the 32 byte buffer with numerous copies and only keep the number that occurs most (given that this only occurs rarely), but this seems a little wasteful.
Cheers,
Kane