By this you mean using the CREN (Continuous Receive Enable bit) mode ?
How exactly do you set the string where you put your command and data information ?
Is it something like :
Code:
COMMAND (7 bytes) + DATA (8 bytes) + Checksum (1 byte) ?
I'm not actually using the serial port for this product. I designed my own one wire bidirectional protocol using PWM.
I.e.
If the pulse of the data on the dataline > 200us then this is a reset (sync)pulse
If the pulse of the dataline >20us and <60us then this is a 1 bit
If the pulse of the dataline >100us and <140us then this is a 0 bit
My product addresses up to a couple of hundred slaves on the data bus so my data format is more along the lines:
<ADDR1><ADDR2><COMMAND1:12><CHECKSUMH><CHECKSUML>
If the ADDR1:ADDR2 don't match up with the device ID on the dataline it still grabs the rest of the code but will not act on it.
If the ADDR1:ADDR2 match up and the checksum is fine, the uC dumps the buffer into its "working" registers and the internal code then translates what is in there to do whatever it has to do.
If the commands/data are telling the slave device that it needs a response, the master waits for a predetermined time for a reply changing its transmit pin to a receive pin and waits for a response. If it doesn't receive it, it tries again. If it still doesn't receive a reply, it carries on with addressing the rest of the slaves and has another go next time round.
I capture all data using the CCP register and use interrupts to allow the rest of the code to run in a multitasking type of manner.