-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CC1101 docs #5614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
CC1101 docs #5614
Changes from all commits
7e9ddf7
e94a724
193427e
db07657
ae1a4e5
88c3871
bcdd7d6
623264f
39f3e19
8d07632
8059126
f6a156c
9488c62
b9d07e6
7d0f999
95de05c
2723afa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,198 @@ | ||||||||
| --- | ||||||||
| title: CC1101 Low-Power Sub-1 GHz RF Transceiver | ||||||||
| description: Instructions for setting up CC1101 RF Transceiver in ESPHome. | ||||||||
| image: /components/images/cc1101.webp | ||||||||
| keywords: [cc1101] | ||||||||
| --- | ||||||||
|
|
||||||||
| The **CC1101** component provides a driver for the **Texas Instruments CC1101** Sub-1 GHz RF Transceiver. | ||||||||
| It allows you to transmit and receive raw RF signals (ASK/OOK, FSK, etc.) using the standard | ||||||||
| [Remote Transmitter](remote_transmitter.md) and [Remote Receiver](remote_receiver.md) components. | ||||||||
|
|
||||||||
| This component requires the [SPI Component](spi.md) to be enabled. | ||||||||
|
|
||||||||
| <img src="/components/images/cc1101.webp" alt="Image" width="50.0%" class="align-center"> | ||||||||
|
|
||||||||
| ## Component Configuration | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| # Minimal Example | ||||||||
| cc1101: | ||||||||
| cs_pin: GPIOXX | ||||||||
| gdo0_pin: GPIOXX | ||||||||
| frequency: 433.92MHz | ||||||||
| ``` | ||||||||
| ## Configuration Variables | ||||||||
| ### Hardware Settings | ||||||||
| - **cs\_pin** (**Required**, [Pin](pin.md)): The SPI Chip Select (CSN) pin connected to the module. | ||||||||
| - **gdo0\_pin** (**Required**, [Pin](pin.md)): The pin connected to **GDO0** on the CC1101. | ||||||||
| - **Note:** `remote_transmitter` **must** use the pin connected to **GDO0** to transmit successfully. | ||||||||
|
|
||||||||
| ### General Settings | ||||||||
|
|
||||||||
| - **frequency** (*Optional*, frequency): The operating frequency. Range: `300MHz` to `928MHz`. Default: `433.92MHz`. | ||||||||
| - **output\_power** (*Optional*, float): The transmission power in dBm. Range: `-30` to `11`. Default: `10`. | ||||||||
| - **modulation\_type** (*Optional*, enum): The modulation format. Options: `ASK/OOK` (default), `2-FSK`, `4-FSK`, `GFSK`, `MSK`. | ||||||||
| - **symbol\_rate** (*Optional*, int): The symbol rate in Baud. Range: `600` to `500000`. Default: `5000`. | ||||||||
| - **rx\_attenuation** (*Optional*, enum): Internal RX attenuation. Options: `0dB`, `6dB`, `12dB`, `18dB`. Default: `0dB`. | ||||||||
| - **dc\_blocking\_filter** (*Optional*, boolean): Enable the digital DC blocking filter. Default: `True`. | ||||||||
|
|
||||||||
| ### Tuner Settings | ||||||||
|
|
||||||||
| - **filter\_bandwidth** (*Optional*, frequency): The receive filter bandwidth. Range: `58kHz` to `812kHz`. Default: `203kHz`. | ||||||||
| - **fsk\_deviation** (*Optional*, frequency): Frequency deviation for FSK/GFSK modulation. | ||||||||
| - **channel** (*Optional*, int): Channel number (added to base frequency). | ||||||||
| - **channel\_spacing** (*Optional*, frequency): Spacing between channels. | ||||||||
| - **if\_frequency** (*Optional*, frequency): Intermediate Frequency. Default is optimized for 433MHz usage. | ||||||||
| - **pktlen** (*Optional*, int): Packet length config. --> | ||||||||
|
|
||||||||
| ### AGC (Automatic Gain Control) Settings | ||||||||
|
|
||||||||
| Advanced users can fine-tune the AGC dynamics. | ||||||||
|
|
||||||||
| - **magn\_target** (*Optional*, dB): Target signal amplitude. Range: `24dB` to `42dB` in increments of 3(eg. `33dB`). | ||||||||
| - **max\_lna\_gain** (*Optional*, dB): Maximum LNA gain reduction. Options: `Default`, `2.6dB`, `6.1dB`, `7.4dB`, `9.2dB`, `11.5dB`, `14.6dB`, `17.1dB`. | ||||||||
| - **max\_dvga\_gain** (*Optional*, enum): Maximum Digital Variable Gain reduction. Options: `Default`, `-1`, `-2`, `-3`. | ||||||||
| - **lna\_priority** (*Optional*, boolean): If true, decrease LNA gain before DVGA gain. | ||||||||
| - **carrier\_sense\_abs\_thr** (*Optional*, int): Absolute RSSI threshold for Carrier Sense. | ||||||||
| - **carrier\_sense\_rel\_thr** (*Optional*, enum): Relative RSSI threshold for Carrier Sense. | ||||||||
| - **filter\_length\_fsk\_msk** (*Optional*, enum): Averaging length for FSK/MSK. | ||||||||
| - **filter\_length\_ask\_ook** (*Optional*, enum): Averaging length for ASK/OOK. | ||||||||
| - **freeze** (*Optional*, enum): AGC gain freeze behavior. | ||||||||
| - **wait\_time** (*Optional*, enum): AGC wait time. | ||||||||
| - **hyst\_level** (*Optional*, enum): AGC hysteresis level. | ||||||||
|
|
||||||||
| ## Actions | ||||||||
|
|
||||||||
| This component provides actions to control the radio state, primarily used for coordinating transmission. | ||||||||
|
|
||||||||
| - **cc1101.begin\_tx**: Wakes the radio and forces it into TX mode. This **must** be called before `remote_transmitter` starts sending data. | ||||||||
| - **cc1101.end\_tx**: Puts the radio back into RX mode and resets the pin configuration to safe defaults. | ||||||||
| - **cc1101.reset**: Resets the CC1101 chip and re-applies configuration. | ||||||||
| - **cc1101.set_idle**: Puts the radio into idle state. | ||||||||
|
|
||||||||
| ### Example Transmit Button | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| button: | ||||||||
| - platform: template | ||||||||
| name: "Send Signal" | ||||||||
| on_press: | ||||||||
| - remote_transmitter.transmit_raw: | ||||||||
| code: [1000, -1000, 1000, -1000] | ||||||||
| repeat: 5 | ||||||||
| ``` | ||||||||
|
|
||||||||
| ## Integration with Remote Receiver/Transmitter | ||||||||
|
|
||||||||
| ### Wiring for Single Pin Usage | ||||||||
|
|
||||||||
| Wire **GDO0** to a single GPIO and use it for both TX and RX. | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| cc1101: | ||||||||
| gdo0_pin: | ||||||||
| pin: | ||||||||
| number: GPIOXX # CC1101 GDO0 | ||||||||
| mode: | ||||||||
| input: true | ||||||||
| output: true | ||||||||
| pullup: true | ||||||||
| open_drain: true | ||||||||
| allow_other_uses: true | ||||||||
| remote_transmitter: | ||||||||
| pin: | ||||||||
| number: GPIOXX # Must match GDO0 | ||||||||
| mode: | ||||||||
| input: true | ||||||||
| output: true | ||||||||
| pullup: true | ||||||||
| open_drain: true | ||||||||
| allow_other_uses: true | ||||||||
swoboda1337 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| carrier_duty_percent: 100% | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| on_transmit: | ||||||||
| then: | ||||||||
| - cc1101.set_idle: | ||||||||
| - remote_transmitter.digital_write: false | ||||||||
| - cc1101.begin_tx: | ||||||||
| on_complete: | ||||||||
| then: | ||||||||
| - cc1101.set_idle: | ||||||||
| - remote_transmitter.digital_write: true | ||||||||
| - cc1101.end_tx: | ||||||||
swoboda1337 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| remote_receiver: | ||||||||
| pin: | ||||||||
| number: GPIOXX # Must match GDO0 | ||||||||
| mode: | ||||||||
| input: true | ||||||||
| output: true | ||||||||
| pullup: true | ||||||||
| open_drain: true | ||||||||
| allow_other_uses: true | ||||||||
| dump: all | ||||||||
| ``` | ||||||||
|
|
||||||||
swoboda1337 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| ### Wiring for Split Pin Usage | ||||||||
|
|
||||||||
| - **GDO0 (Pin 3)**: Connect to the pin used by `remote_transmitter`. | ||||||||
| - **GDO2 (Pin 8)**: Connect to the pin used by `remote_receiver`. | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| cc1101: | ||||||||
| gdo0_pin: | ||||||||
| number: GPIOXX # Must match GDO0 | ||||||||
| mode: | ||||||||
| input: true | ||||||||
| output: true | ||||||||
| pullup: true | ||||||||
| open_drain: true | ||||||||
| allow_other_uses: true | ||||||||
|
Comment on lines
+149
to
+154
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split pin does not require open drain
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do i need input: true on the split pin mode? Also does it need eot_level for the split pin example?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dont need eot_level for split. For split you shouldnt need anything special for pin. |
||||||||
| remote_transmitter: | ||||||||
| pin: | ||||||||
| number: GPIOXX # Must match GDO0 | ||||||||
| mode: | ||||||||
| input: true | ||||||||
| output: true | ||||||||
| pullup: true | ||||||||
| open_drain: true | ||||||||
| allow_other_uses: true | ||||||||
| carrier_duty_percent: 100% | ||||||||
| on_transmit: | ||||||||
| then: | ||||||||
| - cc1101.set_idle: | ||||||||
| - remote_transmitter.digital_write: false | ||||||||
| - cc1101.begin_tx: | ||||||||
| on_complete: | ||||||||
| then: | ||||||||
| - cc1101.set_idle: | ||||||||
| - remote_transmitter.digital_write: true | ||||||||
| - cc1101.end_tx: | ||||||||
| remote_receiver: | ||||||||
| pin: GPIOXX # CC1101 GDO2 | ||||||||
| dump: all | ||||||||
| ``` | ||||||||
|
|
||||||||
| ## Troubleshooting | ||||||||
|
|
||||||||
| ### "FF0F was found" Error | ||||||||
|
|
||||||||
| If you see a log entry stating `FF0F`, `0000`, or `FFFF` during setup, this indicates an SPI communication failure. Check your wiring (MISO/MOSI/CS). | ||||||||
|
|
||||||||
| ### No Signal during Transmit | ||||||||
|
|
||||||||
| - **Check Pinout:** Ensure `remote_transmitter` is assigned to the pin physically connected to **GDO0**. The CC1101 **only** supports transmission via GDO0. | ||||||||
|
|
||||||||
| ## See Also | ||||||||
|
|
||||||||
| - [I²C Bus](/components/i2c) | ||||||||
| - [Remote Receiver](/components/remote_receiver) | ||||||||
| - [Remote Transmitter](/components/remote_transmitter) | ||||||||
| - [SPI Component](/components/spi) | ||||||||
| - [CC1101 Datasheet](https://www.ti.com/lit/ds/symlink/cc1101.pdf) | ||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably remove gdo0_pin from cc1101, it is not needed. It will break single pin on esp32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the input and output direction if you cant use open drain. That is the only time it would be useful for cc1101 to take the gdo0_pin. It should not be available on ESP32. Could also validate it does not have open drain enabled.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to have to document these as separate use cases:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, ill get gdo0 removed.
to be clear, esp32 would still work as dual pin right?
Although, being it can't receive while it transmits, i'm not sure there's really any reason to use the dual pin option? Unless you had more than 1 cc1101 wired to the same device, I think you could share a pin for receive and have separate transmit pins
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah esp32 can work with dual. I mean you don't have to use open drain and can remove the extra writes and state changes in the remote transmitter triggers. So dual is preferred.
You actually do receive when transmitting on a single pin. The receiver actually receives what you transmitted lol. Its actually very handy to debug.