Manchester code (phase encoding) library.
Dependents: Manchester_Transmitter Manchester_Receiver
Manchester code (phase encoding) library
It implements Manchester code according to both IEEE 802.3 and G.E. Thomas' conventions.
- A '0' is expressed by a high-to-low transition, a '1' by low-to-high transition in the IEEE 802.3 convention. The reverse is true in the G.E. Thomas' convention.
- The transitions which signify '0' or '1' occur at the midpoint of a period.
- Transitions at the start of a period are overhead and don't signify data.
- Least significant bit is sent first
- There are synchronization pulses (the number can be set) at the begin of transmission
Select a convention to be used by commenting or uncommenting the line below in theManchester.h
header file.
Manchester.h
#define G_E_THOMAS 1
The IEEE 802.3 convention is used by default.
A Manchester encoded message (using G.E. Thomas' convention), with one sync pulse in the preamble, carrying four bytes:
ACKNOWLEDGEMENT: The code in this library was based on this article published by Robert Guastella.
Import programManchester_Transmitter
Manchester transmitter demo.
Import programManchester_Receiver
Manchester receiver demo.
NOTE: To perform a simple test (without radio modules) connect the txPin on transmitter board to the rxPin on the receiver board and make sure that grounds are also connected one another.
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
8:c1b5893191fe | 2018-10-14 | hudakz | Number of sync pulses in preamble can be set. |
7:afd0ee36dcd1 | 2017-09-03 | hudakz | Updated: Adapted to changes in mbed lib and some comments modified. |
6:7454ad91f714 | 2017-05-22 | hudakz | Updated. |
5:3b2c7e9fda3f | 2017-05-21 | hudakz | Added IEEE 802.3 convention. |
4:f2c392191c74 | 2017-05-18 | hudakz | Updated. |
3:03109c995123 | 2017-05-18 | hudakz | Updated. |
2:de778df5892c | 2017-05-17 | hudakz | Updated. |
1:11292d238e50 | 2017-05-17 | hudakz | Updated. |
0:d5c75b0e5708 | 2017-05-17 | hudakz | Initial issue. |