Difference between revisions of "Protocol decoder:Cc1101"

From sigrok
Jump to navigation Jump to search
(→‎Decoder: Screenshots added)
 
Line 2: Line 2:
| id              = cc1101
| id              = cc1101
| name            = CC1101
| name            = CC1101
| description    = Low-Power Sub-1 GHz RF Transceiver chip
| 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          = cc1101
| output          = —
| probes          = —
| probes          = —
| optional_probes = —
| optional_probes = —
| options        = chip
| options        = —
}}
}}


The '''cc1101''' protocol decoder supports the protocol spoken by the Texas Instruments [http://www.ti.com/product/CC1101 CC1101] sub-1 GHz transceiver chips.
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 73: Line 71:


<small>
<small>
  $ '''sigrok-cli -i sigrok-dumps/spi/cc1l01/cc1l01-read-write.sr \'''
  $ '''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 = "0x16"; STATE is RX, 0 bytes available in RX FIFO
  cc1101-1: Status = 10; STATE is RX, 0 bytes available in RX FIFO
  Status read: PKTSTATUS (0x38) = "0x30"
  cc1101-1: Status read: PKTSTATUS (38) = 30
  STROBE "SIDLE"
  cc1101-1: Strobe SIDLE
  Status = "0x31"; STATE is RX, 15 bytes free in TX FIFO
  cc1101-1: Status = 1F; STATE is RX, 15 bytes free in TX FIFO
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  Write: PKTCTRL1 (0x07) = "0x4C"
  cc1101-1: Write: PKTCTRL1 (07) = 4C
  Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO
  cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO
  Read: PKTCTRL1 (0x07) = "0x4C"
  cc1101-1: Read: PKTCTRL1 (07) = 4C
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  Write: MCSM2 (0x16) = "0x1C"
  cc1101-1: Write: MCSM2 (16) = 1C
  Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO
  cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO
  Read: MCSM2 (0x16) = "0x1C"
  cc1101-1: Read: MCSM2 (16) = 1C
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  Write: WOREVT1 (0x1E) = "0x2F"
  cc1101-1: Write: WOREVT1 (1E) = 2F
  Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO
  cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO
  Read: WOREVT1 (0x1E) = "0x2F"
  cc1101-1: Read: WOREVT1 (1E) = 2F
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  Write: WOREVT0 (0x1F) = "0x65"
  cc1101-1: Write: WOREVT0 (1F) = 65
  Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO
  cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO
  Read: WOREVT0 (0x1F) = "0x65"
  cc1101-1: Read: WOREVT0 (1F) = 65
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  Write: WORCTRL (0x20) = "0x78"
  cc1101-1: Write: WORCTRL (20) = 78
  Status = "0x0"; STATE is IDLE, 0 bytes available in RX FIFO
  cc1101-1: Status = 00; STATE is IDLE, 0 bytes free in TX FIFO
  Read: WORCTRL (0x20) = "0x78"
  cc1101-1: Read: WORCTRL (20) = 78
  STROBE "SWORRST"
  cc1101-1: Strobe SWORRST
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
  STROBE "SWOR"
  cc1101-1: Strobe SWOR
  Status = "0x15"; STATE is IDLE, 15 bytes free in TX FIFO
  cc1101-1: Status = 0F; STATE is IDLE, 15 bytes free in TX FIFO
</small>
</small>



Latest revision as of 23:45, 18 April 2019

cc1101
CC1101 module.jpg
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.

Resources