I'm working on a setup in where multiple devices (about 25) each running on 8051 based micros connect to each other via wireless UARTS (specifically the HM-TRP radio modules).
At this moment, my packet format is as follows:
Byte 1: Recipient
Byte 2: Sender
Bytes 3 - 28: Data
Byte 29: Checksum
I ran my entire code through a simulator (uCsim) and all results are perfect. I run it on real hardware and use LED's for debugging and the checksum never passes.
When I was using the wireless modules in the past, I did notice a loss of random bytes at times, so maybe I could blame the wireless settings?
For clarification, I configured the module as follows:
- Air and UART rate: 56Kbps
- Deviation Frequency: 58Khz
- Bandwidth: 175Khz (58Khz times 2 + baud) (I'm trying to follow carsons rule?)
- Maximum transmit power
All other values in the module are at defaults.
I'm curious. Could I get much better luck if I send and receive only 4 bytes at a time wirelessly?
I'm talking about this packet format:
Byte 1: Recipient
Byte 2: Sender
Byte 3: Data
Byte 4: Checksum
Or maybe 3 bytes and have the checksum as last packet and have packets as follows:
Packet 1-n:
Byte 1: Recipient
Byte 2: Sender
Byte 3: Data
Last packet:
Byte 1: Recipient
Byte 2: Sender
Byte 3: Checksum for last n packets
Which would be best in the wireless world? I want to be able to send lots of data but I don't want data missing in the air in the process.