Protocol decoder:cc1101

From sigrok
Revision as of 18:45, 29 March 2019 by Stan23 (talk | contribs) (→‎Decoder: Screenshots added)
Jump to navigation Jump to search
cc1101
CC1101 module.jpg
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.

Resources