![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
unlimited packet length example for sx1272 or sx1276
operating
user button on MCU board toggles between receive operation on radio and transmit. (Latching PTT). Look at serial terminal at 9600 to see operation. User button is pressed once to start transmit, and again to end transmit: it doesnt need to be held down during TX.
example payload
The example payload is a continuously incrementing byte, with zero at start of packet.
End of packet is detected by four consecutive bytes which dont increment with expected value: background noise, this indicates transmitter has finished. This serves only as an example, because some other method would likely be needed in an application, such as unique data indicating end, or the length sent at begin of packet.
flow control
FifoThreshold is used for transmit flow control. With fifo is below threshold, bytes are send to the radio's fifo. While fifo is above threshold, nothing is sent until the fifo threshold pin returns low. AKA FifoLevel
pin.
On receive, the packet reception is initialized by SyncAddress
pin going high, indicating start of packet. Bytes are read from FIFO when the FifoEmpty
pin is low.
The packet buffer (AKA FIFO) in sx127x is only 64 bytes, meaning the maximum time between FifoFull
and FifoEmpty
would be 512 bit periods. This needs to be considered: the MCU latency of servicing FifoLevel
, FifoEmpty
pins during packet, otherwise empty byte would be sent on transmit or byte missed on receiver.
FSK reception
The rxTrigger is used on preamble to enable start-of-frame detection, aka sync word. When end of packet is detected, the receiver is restarted. In this case, restarted with PLL when AFC is used, or without PLL when AFC not enabled.
The serial terminal will show when packet reception starts, and when there are incorrect bytes received over the air. This will always happen and end of packet for this example.
mbed-os.lib@0:df5ce1bc5036, 2021-09-14 (annotated)
- Committer:
- dudmuck
- Date:
- Tue Sep 14 22:19:57 2021 +0000
- Revision:
- 0:df5ce1bc5036
commit initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudmuck | 0:df5ce1bc5036 | 1 | https://github.com/ARMmbed/mbed-os/#b1796dedeb8accde1cbaecf136fab96895e23d81 |