Difference between revisions of "Protocol decoder:Cc1101"
(created, using nrf24l01 as template) |
Uwe Hermann (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
| id = cc1101 | | id = cc1101 | ||
| name = CC1101 | | name = CC1101 | ||
| description = Low- | | description = Low-power sub-1GHz RF transceiver chip | ||
| status = supported | | status = supported | ||
| license = GPLv2+ | | license = GPLv2+ | ||
Line 8: | Line 8: | ||
| image = [[File:CC1101_module.jpg|250px]] | | image = [[File:CC1101_module.jpg|250px]] | ||
| input = [[Protocol decoder:spi|spi]] | | input = [[Protocol decoder:spi|spi]] | ||
| output = | | output = — | ||
| probes = — | | probes = — | ||
| optional_probes = — | | optional_probes = — | ||
| options = | | options = — | ||
}} | }} | ||
The '''cc1101''' protocol decoder supports the protocol spoken by the | The '''cc1101''' protocol decoder supports the protocol spoken by the [http://www.ti.com/product/CC1101 Texas Instruments CC1101] sub-1GHz transceiver chips. | ||
== Hardware == | == Hardware == | ||
Line 49: | Line 49: | ||
| CSn | | CSn | ||
|} | |} | ||
== Protocol == | == Protocol == | ||
Line 56: | Line 55: | ||
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. | 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 == | == Decoder == | ||
Line 65: | Line 63: | ||
<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> | ||
Line 71: | Line 71: | ||
<small> | <small> | ||
$ '''sigrok-cli -i sigrok-dumps/spi/ | $ '''sigrok-cli -i sigrok-dumps/spi/cc1101/cc1101-read-write.sr \''' | ||
'''-P spi:clk=CLK:mosi=MOSI:miso=MISO:cs=CS,cc1101''' | '''-P spi:clk=CLK:mosi=MOSI:miso=MISO:cs=CS,cc1101 -A cc1101''' | ||
Status = | cc1101-1: Status = 10; STATE is RX, 0 bytes available in RX FIFO | ||
Status read: PKTSTATUS ( | cc1101-1: Status read: PKTSTATUS (38) = 30 | ||
cc1101-1: Strobe SIDLE | |||
Status = | cc1101-1: Status = 1F; STATE is RX, 15 bytes free in TX FIFO | ||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
Write: PKTCTRL1 ( | cc1101-1: Write: PKTCTRL1 (07) = 4C | ||
Status = | cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO | ||
Read: PKTCTRL1 ( | cc1101-1: Read: PKTCTRL1 (07) = 4C | ||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
Write: MCSM2 ( | cc1101-1: Write: MCSM2 (16) = 1C | ||
Status = | cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO | ||
Read: MCSM2 ( | cc1101-1: Read: MCSM2 (16) = 1C | ||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
Write: WOREVT1 ( | cc1101-1: Write: WOREVT1 (1E) = 2F | ||
Status = | cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO | ||
Read: WOREVT1 ( | cc1101-1: Read: WOREVT1 (1E) = 2F | ||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
Write: WOREVT0 ( | cc1101-1: Write: WOREVT0 (1F) = 65 | ||
Status = | cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO | ||
Read: WOREVT0 ( | cc1101-1: Read: WOREVT0 (1F) = 65 | ||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
Write: WORCTRL ( | cc1101-1: Write: WORCTRL (20) = 78 | ||
Status = | cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO | ||
Read: WORCTRL ( | cc1101-1: Read: WORCTRL (20) = 78 | ||
cc1101-1: Strobe SWORRST | |||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
cc1101-1: Strobe SWOR | |||
Status = | cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO | ||
</small> | </small> | ||
Latest revision as of 23:45, 18 April 2019
Name | CC1101 |
---|---|
Description | Low-power sub-1GHz RF transceiver chip |
Status | supported |
License | GPLv2+ |
Source code | decoders/cc1101 |
Input | spi |
Output | — |
Probes | — |
Optional probes | — |
Options | — |
The cc1101 protocol decoder supports the protocol spoken by the Texas Instruments CC1101 sub-1GHz 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/cc1101/cc1101-read-write.sr \ -P spi:clk=CLK:mosi=MOSI:miso=MISO:cs=CS,cc1101 -A cc1101 cc1101-1: Status = 10; STATE is RX, 0 bytes available in RX FIFO cc1101-1: Status read: PKTSTATUS (38) = 30 cc1101-1: Strobe SIDLE cc1101-1: Status = 1F; STATE is RX, 15 bytes free in TX FIFO cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Write: PKTCTRL1 (07) = 4C cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO cc1101-1: Read: PKTCTRL1 (07) = 4C cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Write: MCSM2 (16) = 1C cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO cc1101-1: Read: MCSM2 (16) = 1C cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Write: WOREVT1 (1E) = 2F cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO cc1101-1: Read: WOREVT1 (1E) = 2F cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Write: WOREVT0 (1F) = 65 cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO cc1101-1: Read: WOREVT0 (1F) = 65 cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Write: WORCTRL (20) = 78 cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO cc1101-1: Read: WORCTRL (20) = 78 cc1101-1: Strobe SWORRST cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO cc1101-1: Strobe SWOR cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
The status response is decoded.