Skip to content

Commit 5506883

Browse files
committed
Update for new code commit
1 parent 2723afa commit 5506883

File tree

1 file changed

+82
-76
lines changed

1 file changed

+82
-76
lines changed

content/components/cc1101.md

Lines changed: 82 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -16,106 +16,114 @@ This component requires the [SPI Component](spi.md) to be enabled.
1616
## Component Configuration
1717

1818
```yaml
19-
# Minimal Example
19+
# Minimal Example (DUAL_PIN is the default operation_mode)
2020
cc1101:
2121
cs_pin: GPIOXX
22-
gdo0_pin: GPIOXX
2322
frequency: 433.92MHz
2423
```
2524
2625
## Configuration Variables
2726
2827
### Hardware Settings
28+
- **cs_pin** (**Required**, [Pin](pin.md)): The SPI Chip Select (CSN) pin connected to the module.
2929
30-
- **cs\_pin** (**Required**, [Pin](pin.md)): The SPI Chip Select (CSN) pin connected to the module.
31-
- **gdo0\_pin** (**Required**, [Pin](pin.md)): The pin connected to **GDO0** on the CC1101.
32-
- **Note:** `remote_transmitter` **must** use the pin connected to **GDO0** to transmit successfully.
30+
- **operation_mode** (Optional, enum): Defines the role of the CC1101 GDO pins based on your wiring setup. This is crucial for correct TX/RX operation.
31+
- `DUAL_PIN` (Default): Configures the module for separate TX and RX data pins. Internally sets GDO0 (Module Pin 3) for TX Data Input and GDO2 (Module Pin 8) for RX Data Output. This is the recommended mode.
32+
- `SINGLE_PIN`: Configures GDO0 (Module Pin 3) for bi-directional Serial I/O and sets GDO2 to high impedance. This mode requires only one MCU GPIO pin for both TX and RX.
3333

3434
### General Settings
3535

3636
- **frequency** (*Optional*, frequency): The operating frequency. Range: `300MHz` to `928MHz`. Default: `433.92MHz`.
37-
- **output\_power** (*Optional*, float): The transmission power in dBm. Range: `-30` to `11`. Default: `10`.
38-
- **modulation\_type** (*Optional*, enum): The modulation format. Options: `ASK/OOK` (default), `2-FSK`, `4-FSK`, `GFSK`, `MSK`.
39-
- **symbol\_rate** (*Optional*, int): The symbol rate in Baud. Range: `600` to `500000`. Default: `5000`.
40-
- **rx\_attenuation** (*Optional*, enum): Internal RX attenuation. Options: `0dB`, `6dB`, `12dB`, `18dB`. Default: `0dB`.
41-
- **dc\_blocking\_filter** (*Optional*, boolean): Enable the digital DC blocking filter. Default: `True`.
37+
- **output_power** (*Optional*, float): The transmission power in dBm. Range: `-30` to `11`. Default: `10`.
38+
- **modulation_type** (*Optional*, enum): The modulation format. Options: `ASK/OOK` (default), `2-FSK`, `4-FSK`, `GFSK`, `MSK`.
39+
- **symbol_rate** (*Optional*, int): The symbol rate in Baud. Range: `600` to `500000`. Default: `5000`.
40+
- **rx_attenuation** (*Optional*, enum): Internal RX attenuation. Options: `0dB`, `6dB`, `12dB`, `18dB`. Default: `0dB`.
41+
- **dc_blocking_filter** (*Optional*, boolean): Enable the digital DC blocking filter. Default: `True`.
4242

4343
### Tuner Settings
4444

45-
- **filter\_bandwidth** (*Optional*, frequency): The receive filter bandwidth. Range: `58kHz` to `812kHz`. Default: `203kHz`.
46-
- **fsk\_deviation** (*Optional*, frequency): Frequency deviation for FSK/GFSK modulation.
45+
- **filter_bandwidth** (*Optional*, frequency): The receive filter bandwidth. Range: `58kHz` to `812kHz`. Default: `203kHz`.
46+
- **fsk_deviation** (*Optional*, frequency): Frequency deviation for FSK/GFSK modulation.
4747
- **channel** (*Optional*, int): Channel number (added to base frequency).
48-
- **channel\_spacing** (*Optional*, frequency): Spacing between channels.
49-
- **if\_frequency** (*Optional*, frequency): Intermediate Frequency. Default is optimized for 433MHz usage.
50-
- **pktlen** (*Optional*, int): Packet length config. -->
48+
- **channel_spacing** (*Optional*, frequency): Spacing between channels.
49+
- **if_frequency** (*Optional*, frequency): Intermediate Frequency. Default is optimized for 433MHz usage.
50+
- **pktlen** (*Optional*, int): Packet length config.
5151

5252
### AGC (Automatic Gain Control) Settings
5353

5454
Advanced users can fine-tune the AGC dynamics.
5555

56-
- **magn\_target** (*Optional*, dB): Target signal amplitude. Range: `24dB` to `42dB` in increments of 3(eg. `33dB`).
57-
- **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`.
58-
- **max\_dvga\_gain** (*Optional*, enum): Maximum Digital Variable Gain reduction. Options: `Default`, `-1`, `-2`, `-3`.
59-
- **lna\_priority** (*Optional*, boolean): If true, decrease LNA gain before DVGA gain.
60-
- **carrier\_sense\_abs\_thr** (*Optional*, int): Absolute RSSI threshold for Carrier Sense.
61-
- **carrier\_sense\_rel\_thr** (*Optional*, enum): Relative RSSI threshold for Carrier Sense.
62-
- **filter\_length\_fsk\_msk** (*Optional*, enum): Averaging length for FSK/MSK.
63-
- **filter\_length\_ask\_ook** (*Optional*, enum): Averaging length for ASK/OOK.
56+
- **magn_target** (*Optional*, dB): Target signal amplitude. Range: `24dB` to `42dB` in increments of 3(eg. `33dB`).
57+
- **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`.
58+
- **max_dvga_gain** (*Optional*, enum): Maximum Digital Variable Gain reduction. Options: `Default`, `-1`, `-2`, `-3`.
59+
- **lna_priority** (*Optional*, boolean): If true, decrease LNA gain before DVGA gain.
60+
- **carrier_sense_abs_thr** (*Optional*, int): Absolute RSSI threshold for Carrier Sense.
61+
- **carrier_sense_rel_thr** (*Optional*, enum): Relative RSSI threshold for Carrier Sense.
62+
- **filter_length_fsk_msk** (*Optional*, enum): Averaging length for FSK/MSK.
63+
- **filter_length_ask_ook** (*Optional*, enum): Averaging length for ASK/OOK.
6464
- **freeze** (*Optional*, enum): AGC gain freeze behavior.
65-
- **wait\_time** (*Optional*, enum): AGC wait time.
66-
- **hyst\_level** (*Optional*, enum): AGC hysteresis level.
65+
- **wait_time** (*Optional*, enum): AGC wait time.
66+
- **hyst_level** (*Optional*, enum): AGC hysteresis level.
6767

6868
## Actions
6969

7070
This component provides actions to control the radio state, primarily used for coordinating transmission.
7171

72-
- **cc1101.begin\_tx**: Wakes the radio and forces it into TX mode. This **must** be called before `remote_transmitter` starts sending data.
73-
- **cc1101.end\_tx**: Puts the radio back into RX mode and resets the pin configuration to safe defaults.
72+
- **cc1101.begin_tx**: Wakes the radio and forces it into TX mode. This **must** be called before `remote_transmitter` starts sending data.
73+
- **cc1101.end_tx**: Puts the radio back into RX mode and resets the pin configuration to safe defaults.
7474
- **cc1101.reset**: Resets the CC1101 chip and re-applies configuration.
7575
- **cc1101.set_idle**: Puts the radio into idle state.
7676

77-
### Example Transmit Button
77+
## Integration with Remote Receiver/Transmitter
78+
79+
### 1. Dual Pin Wiring (operation_mode: DUAL_PIN)
80+
This mode is recommended for simplicity and clarity. The CC1101 chip handles the input/output logic internally, requiring minimal external pin configuration.
81+
82+
- **GDO0 (Module Pin 3)**: Connect to the MCU pin used by `remote_transmitter`.
83+
- **GDO2 (Module Pin 8)**: Connect to the MCU pin used by `remote_receiver`.
7884

7985
```yaml
80-
button:
81-
- platform: template
82-
name: "Send Signal"
83-
on_press:
84-
- remote_transmitter.transmit_raw:
85-
code: [1000, -1000, 1000, -1000]
86-
repeat: 5
87-
```
86+
cc1101:
87+
cs_pin: GPIOXX
8888
89-
## Integration with Remote Receiver/Transmitter
89+
remote_transmitter:
90+
pin: GPIOXX # Must match GDO0
91+
carrier_duty_percent: 100%
92+
on_transmit:
93+
then:
94+
- cc1101.set_idle:
95+
- remote_transmitter.digital_write: false
96+
- cc1101.begin_tx:
97+
on_complete:
98+
then:
99+
- cc1101.set_idle:
100+
- remote_transmitter.digital_write: true
101+
- cc1101.end_tx:
90102
91-
### Wiring for Single Pin Usage
103+
remote_receiver:
104+
pin: GPIOXX # CC1101 GDO2
105+
dump: all
106+
```
92107

93-
Wire **GDO0** to a single GPIO and use it for both TX and RX.
108+
### 2. Single Pin Wiring - Push-Pull (with State Switching)
109+
This mode requires only one MCU GPIO pin connected to GDO0 (Module Pin 3). Since the MCU pin operates in Push-Pull mode, manual switching between Input and Output logic is required inside the automation to avoid conflicts.
110+
111+
- **GDO0 (Module Pin 3)**: Connect to a single MCU GPIO pin.
112+
- **GDO2 (Module Pin 8)**: Leave disconnected.
94113

95114
```yaml
96115
cc1101:
97-
gdo0_pin:
98-
pin:
99-
number: GPIOXX # CC1101 GDO0
100-
mode:
101-
input: true
102-
output: true
103-
pullup: true
104-
open_drain: true
105-
allow_other_uses: true
116+
cs_pin: GPIOXX
117+
operation_mode: SINGLE_PIN
106118
107119
remote_transmitter:
108-
pin:
120+
pin:
109121
number: GPIOXX # Must match GDO0
110-
mode:
111-
input: true
112-
output: true
113-
pullup: true
114-
open_drain: true
115122
allow_other_uses: true
116123
carrier_duty_percent: 100%
117124
on_transmit:
118125
then:
126+
- remote_receiver.disable:
119127
- cc1101.set_idle:
120128
- remote_transmitter.digital_write: false
121129
- cc1101.begin_tx:
@@ -124,44 +132,36 @@ remote_transmitter:
124132
- cc1101.set_idle:
125133
- remote_transmitter.digital_write: true
126134
- cc1101.end_tx:
135+
- remote_receiver.enable:
127136
128137
remote_receiver:
129-
pin:
138+
pin:
130139
number: GPIOXX # Must match GDO0
131-
mode:
132-
input: true
133-
output: true
134-
pullup: true
135-
open_drain: true
136140
allow_other_uses: true
137141
dump: all
138142
```
139143

140-
### Wiring for Split Pin Usage
144+
### 3. Single Pin Wiring - Open Drain
145+
This mode also requires only one MCU GPIO pin connected to GDO0 (Module Pin 3), but is simpler as the Open Drain configuration automatically handles the logic state switching without needing complex on_transmit/on_complete automation logic.
141146

142-
- **GDO0 (Pin 3)**: Connect to the pin used by `remote_transmitter`.
143-
- **GDO2 (Pin 8)**: Connect to the pin used by `remote_receiver`.
147+
- **GDO0 (Module Pin 3)**: Connect to a single MCU GPIO pin configured as Open Drain.
148+
- **GDO2 (Module Pin 8)**: Leave disconnected.
144149

145150
```yaml
146151
cc1101:
147-
gdo0_pin:
148-
number: GPIOXX # Must match GDO0
149-
mode:
150-
input: true
151-
output: true
152-
pullup: true
153-
open_drain: true
154-
allow_other_uses: true
152+
cs_pin: GPIOXX
153+
operation_mode: SINGLE_PIN
155154
156155
remote_transmitter:
157-
pin:
156+
pin:
158157
number: GPIOXX # Must match GDO0
159158
mode:
160159
input: true
161160
output: true
162161
pullup: true
163162
open_drain: true
164163
allow_other_uses: true
164+
eot_level: false
165165
carrier_duty_percent: 100%
166166
on_transmit:
167167
then:
@@ -175,19 +175,25 @@ remote_transmitter:
175175
- cc1101.end_tx:
176176
177177
remote_receiver:
178-
pin: GPIOXX # CC1101 GDO2
178+
pin:
179+
number: GPIOXX # Must match GDO0
180+
mode:
181+
input: true
182+
output: true
183+
pullup: true
184+
open_drain: true
185+
allow_other_uses: true
179186
dump: all
180187
```
181188

182189
## Troubleshooting
183190

184191
### "FF0F was found" Error
185-
186192
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).
187193

188194
### No Signal during Transmit
189-
190-
- **Check Pinout:** Ensure `remote_transmitter` is assigned to the pin physically connected to **GDO0**. The CC1101 **only** supports transmission via GDO0.
195+
- **Check Pinout**: For all modes, the data line must be connected to GDO0 (Module Pin 3), as the CC1101 chip only supports transmission input via the GDO0 pin.
196+
- **Check Pin Mode**: If using the Single Pin Push-Pull mode, ensure your on_transmit/on_complete logic correctly flips the pin's status.
191197

192198
## See Also
193199

0 commit comments

Comments
 (0)