Difference between revisions of "Protocol decoder:Cc1101"
(created, using nrf24l01 as template) |
(→Decoder: Screenshots added) |
||
Line 65: | Line 65: | ||
<gallery> | <gallery> | ||
File:CC1101_PD_strobe.png|<small>Decoded strobe command.</small> | |||
File:CC1101_PD_status_register_read.png|<small>Decoded register read of the MARCSTATE register.</small> | |||
File:CC1101_PD_burst_write.png|<small>Decoded burst write.</small> | |||
</gallery> | </gallery> | ||
Revision as of 17:45, 29 March 2019
Name | CC1101 |
---|---|
Description | Low-Power Sub-1 GHz RF Transceiver chip |
Status | supported |
License | GPLv2+ |
Source code | decoders/cc1101 |
Input | spi |
Output | cc1101 |
Probes | — |
Optional probes | — |
Options | chip |
The cc1101 protocol decoder supports the protocol spoken by the Texas Instruments CC1101 sub-1 GHz transceiver chips.
Hardware
Modules with these chips can be purchased fairly inexpensive from various online marketplaces. Most (all?) have an 8-pin header with the following pinout:
Pin | Function |
---|---|
1 | VCC |
2 | GND |
3 | MOSI |
4 | CLK |
5 | MISO |
6 | GDO2 |
7 | GDO0 |
8 | CSn |
Protocol
The chip uses the standard SPI protocol and pins (CSn, SCK, MOSI, MISO), with the additional GDO0 and GDO2 pins. They are configurable and can be used to inform the SPI master about the completion of a packet reception/transmission.
SPI commands can have variable length, the CSn signal has to stay low during the whole command, and then go high after the last byte. The first byte of a command defines the type of the command, the chip always outputs its internal status register at the beginning. The following bytes are dependent on the command type, can be register values to write into the chip or payload data to send, or empty bytes that are ignored if the command only reads the output of the chip.
Decoder
The cc1101 decoder stacks on top of the SPI decoder and decodes the commands to the chip and the responses of the chip, and also issues warnings for wrong/incomplete commands.
Some decoded commands in PulseView:
sigrok-cli can be used to decode the capture in the following way:
$ sigrok-cli -i sigrok-dumps/spi/cc1l01/cc1l01-read-write.sr \ -P spi:clk=CLK:mosi=MOSI:miso=MISO:cs=CS,cc1101 Status = "0x16"; STATE is RX, 0 bytes available in RX FIFO Status read: PKTSTATUS (0x38) = "0x30" STROBE "SIDLE" Status = "0x31"; STATE is RX, 15 bytes free in TX FIFO Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO Write: PKTCTRL1 (0x07) = "0x4C" Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO Read: PKTCTRL1 (0x07) = "0x4C" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO Write: MCSM2 (0x16) = "0x1C" Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO Read: MCSM2 (0x16) = "0x1C" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO Write: WOREVT1 (0x1E) = "0x2F" Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO Read: WOREVT1 (0x1E) = "0x2F" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO Write: WOREVT0 (0x1F) = "0x65" Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO Read: WOREVT0 (0x1F) = "0x65" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO Write: WORCTRL (0x20) = "0x78" Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO Read: WORCTRL (0x20) = "0x78" STROBE "SWORRST" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO STROBE "SWOR" Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
The status response is decoded.