Signals such as PWM, PPM, and S-BUS are relatively common in the field of communication. How much do you know? Let’s analyze them for you.
PWM: Pulse Width ModulaTIon, that is, pulse width modulation.
Two important parameters:Pulse Width(that is, the high-level time of the waveform in the following figure),cycle(period x frequency = 1).
Regarding the content of PWM, I don’t need to say much here. PWM is a kind of signal that everyone who studies electronics or low-level programming knows. Now many MCUs can generate PWM waveforms, and can also detect PWM waveforms. For details, please refer to my previous articles.
PPM: Pulse PosiTIon ModulaTIon, namely pulse position modulation.
Because PWM processing is simple,Only 1 signal is transmitted in each physical connection. In other words, if you need to transmit several channels, you need several sets of physical connections.
But in some occasions, we don’t need to drive the device directly, but need to get the values of multiple channels of the receiver first. Therefore, PPM is derived, as shown below:
In simple terms, it is to transmit multiple different PWM signals in one cycle (20ms)., there is an interval between each cycle to separate.
Because a long enough blank (significantly more than the width of a normal PWM signal) must be added to the tail of each frame of signal to separate the two signals before and after,Each frame can only transmit up to 8 signal channels. This is enough for most occasions, and PPM is a common standard, and most brands of remote control/reception support it.
PPM communication protocol:
High-level voltage: common 4.8~6V.
Signal period: 24ms.
Single pulse width: 0.4ms
Pulse spacing: 0.9ms to 2.1ms
S-BUS: Serial Bus, the serial bus.
In simple terms, S-BUS is the serial transmission and communication of PWM signals.
One byte is equal to:
1 startbit + 8 data bits + 1 parity bit + 2 stop bits (8E2), baud rate = 100’000 bit/s
MSB is sent first. Logic Inversion (Level High = 1)
A frame of data:
25 bytes per frame, the frame format is as follows:
[startbyte] [data1] [data2] …. [data22] [flags][endbyte]
start byte = 11110000b (0xF0)
data 1-22 = [ch1, 11bit] [ch2, 11bit] …. [ch16, 11bit] (ch#=0 bis 2047)
Channel 1 uses 8 bits from data1 and 3 bits from data2
Channel 2 uses the last 5 bits from data2 and from data3
6 bits etc.
flags = bit7 = ch17 = digital channel (0x80)
bit6 = ch18 = digital channel (0x40)
bit5 = frame lost, equivalent red LED on receiver (0x20)
bit4 = Failsafe active (0x10)
bit3 = n/a
bit2 = n / a
bit1 = n / a
bit0 = n / a
Interval time between two frames of data:
High speed mode: 7ms
Simulation mode: 14ms
S-BUS can be implemented using a UART controller. There are many tutorials on the Internet, and interested friends can learn about it.