col_implant
New Member
Hi,
I'm developing RF communication using two PIC18F2520s and melexis TX / RX ICs for a medical implant. Data transmission has been verified, as has reception up to the input pin of the RX PIC USART.
My data is Manchester coded, as recommended, and I'm wondering how to synchronize the receiver PIC USART since standard serial start bit (long one followed by a transition to zero, or vice versa) cannot be implemented. The preamble we use is 0x55 three times (i.e. clock run 01010101 x3) followed by start byte 0x75.
The problem is that in initial RX IC synchronization it often takes one or two bit toggles to receive data so the first bits of the preamble are often lost. The USART RCIF flag seems to go high at random and the data in the RCREG is not correct (most often 0x00). This even occurs when no data is transmitted, since digital noise is output from the RX IC. To some extent this can be minimized by monitoring the RX IC RSSI level and only looking at the RCREG when the RSSI level is above a certain threshold.
However if I send only one data byte (or two Manchester encoded) and search the RCREG only for the start code 0x75 it seems to work, regardless of whether the bits of the preamble are lost or not. Its makes no sense that the USART knows where the 0x75 byte starts and ends if there is say 2 1/2 preamble bytes before it. This is a solution but obviously not optimum as preamble/start code would need to be sent for each data byte.
Any help would be greatly appreciated.
I'm developing RF communication using two PIC18F2520s and melexis TX / RX ICs for a medical implant. Data transmission has been verified, as has reception up to the input pin of the RX PIC USART.
My data is Manchester coded, as recommended, and I'm wondering how to synchronize the receiver PIC USART since standard serial start bit (long one followed by a transition to zero, or vice versa) cannot be implemented. The preamble we use is 0x55 three times (i.e. clock run 01010101 x3) followed by start byte 0x75.
The problem is that in initial RX IC synchronization it often takes one or two bit toggles to receive data so the first bits of the preamble are often lost. The USART RCIF flag seems to go high at random and the data in the RCREG is not correct (most often 0x00). This even occurs when no data is transmitted, since digital noise is output from the RX IC. To some extent this can be minimized by monitoring the RX IC RSSI level and only looking at the RCREG when the RSSI level is above a certain threshold.
However if I send only one data byte (or two Manchester encoded) and search the RCREG only for the start code 0x75 it seems to work, regardless of whether the bits of the preamble are lost or not. Its makes no sense that the USART knows where the 0x75 byte starts and ends if there is say 2 1/2 preamble bytes before it. This is a solution but obviously not optimum as preamble/start code would need to be sent for each data byte.
Any help would be greatly appreciated.