https://github.com/nopnop2002/esp-idf-cc1101
CC1101 Low-Power Sub-1 GHz RF Transceiver driver for esp-idf
https://github.com/nopnop2002/esp-idf-cc1101
cc1101 esp-idf esp32
Last synced: about 1 month ago
JSON representation
CC1101 Low-Power Sub-1 GHz RF Transceiver driver for esp-idf
- Host: GitHub
- URL: https://github.com/nopnop2002/esp-idf-cc1101
- Owner: nopnop2002
- License: lgpl-3.0
- Created: 2022-03-14T05:30:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T13:24:19.000Z (4 months ago)
- Last Synced: 2025-04-01T01:01:42.472Z (3 months ago)
- Topics: cc1101, esp-idf, esp32
- Language: C
- Homepage:
- Size: 175 KB
- Stars: 60
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp-idf-cc1101
CC1101 Low-Power Sub-1 GHz RF Transceiver driver for esp-idf.I based it on [this](https://github.com/veonik/arduino-cc1101).
- EBYTE E07-400M10S 433MHz module(1.27mm pitch)
The official Product Descriptio is [here](https://www.cdebyte.com/products/E07-400M10S).
Supports frequencies from 410MHz to 450MHz.
- HW-862 315/433MHz module(2.54mm pitch)
Supported frequencies are 300-348MHz and 400-464MHz.
- EBYTE E07-M1101D-SMA 433MHz module(2.54mm pitch)
The official Product Descriptio is [here](https://www.cdebyte.com/products/E07-M1101D-SMA).
Supports frequencies from 387MHz to 464MHz.

- EBYTE E07-M1101D-TH 433MHz module(2.54mm pitch)
The official Product Descriptio is [here](https://www.cdebyte.com/products/E07-M1101D-TH).
Supports frequencies from 387MHz to 464MHz.

- AS07-M1101S 433MHz module(1.27mm pitch)
The supported frequency bands are unknown.
315MHz and 433MHz can be used.
GOD1 is MISO.

- EBYTE E07-900M10S 868/915MHz module(1.27mm pitch)
The official Product Descriptio is [here](https://www.cdebyte.com/products/E07-900M10S).
Supports frequencies from 855MHz to 925MHz.
- CC11010 868MHz module(2mm pitch)
The supported frequency bands are unknown.
868MHz transceivers typically support frequencies from 855MHz to 925MHz.

# Changes from the original
- The 918MHz setting has been abolished.
- Added 315MHz setting.
- TX power setting was changed.# Software requirements
ESP-IDF V5.0 or later.
ESP-IDF V4.4 release branch reached EOL in July 2024.
ESP-IDF V5.1 is required when using ESP32-C6.# Installation
```Shell
git clone https://github.com/nopnop2002/esp-idf-cc1101
cd esp-idf-cc1101/basic
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash
```__Note for ESP32C3__
For some reason, there are development boards that cannot use GPIO06, GPIO08, GPIO09, GPIO19 for SPI clock pins.
According to the ESP32C3 specifications, these pins can also be used as SPI clocks.
I used a raw ESP-C3-13 to verify that these pins could be used as SPI clocks.# Configuration for Transceiver

# Frequency selection
# Modulation speed selection
# Output power Selection
Default power level.
||315MHz|433MHz|868MHz|915MHz|
|:-:|:-:|:-:|:-:|:-:|
|Output Power|8.5dBm|7.8dBm|8.5dBm|7.2dBm|
|Current Consumption|24.4mA|25.2mA|29.5mA|27.4mA|Minimum power level is -30dBm.
||315MHz|433MHz|868MHz|915MHz|
|:-:|:-:|:-:|:-:|:-:|
|Current Consumption|10.9mA|11.9mA|12.1mA|12.0mA|Power lebel is 0dBm.
||315MHz|433MHz|868MHz|915MHz|
|:-:|:-:|:-:|:-:|:-:|
|Current Consumption|15.0mA|15.9mA|16.9mA|16.7mA|Maximum power level is 10dBm.
||315MHz|433MHz|868MHz|915MHz|
|:-:|:-:|:-:|:-:|:-:|
|Current Consumption|26.9mA|29.1mA|32.4mA|31.8mA|# The frequency used by the transceiver
The frequency used by the transceiver is determined by the XOSC (crystal oscillator) implemented in the hardware.
The XOSC (Crystal Oscillator) is a small silver component on the board.
Many transceivers are equipped with a 26MHz XOSC.
The frequency used by the transceiver is determined by the XOSC frequency and registers value.
```
Fcarrier = { Fxosc / 2**16 } * FREQ[23:0]Fcarrier is the frequency used by the transceiver
Fxosc is the XOSC frequency
FREQ[23:0] is the register value
```This library uses the following register values:
- 315MHz
Fcarrier = { 26MHz / 2**16 } * 0x0C1D89 = 314.999664MHz- 433MHz
Fcarrier = { 26MHz / 2**16 } * 0x10A762 = 432.999817MHz- 868MHz
Fcarrier = { 26MHz / 2**16 } * 0x216276 = 867.999939MHz- 915MHz
Fcarrier = { 26MHz / 2**16 } * 0x23313B = 914.999969MHz# SPI BUS selection
The ESP32 series has three SPI BUSs.
SPI1_HOST is used for communication with Flash memory.
You can use SPI2_HOST and SPI3_HOST freely.
When you use SDSPI(SD Card via SPI), SDSPI uses SPI2_HOST BUS.
When using this module at the same time as SDSPI or other SPI device using SPI2_HOST, it needs to be changed to SPI3_HOST.
When you don't use SDSPI, both SPI2_HOST and SPI3_HOST will work.
Previously it was called HSPI_HOST / VSPI_HOST, but now it is called SPI2_HOST / SPI3_HOST.# Wirering
|CC1101||ESP32|ESP32-S2/S3|ESP32-C2/C3/C6|
|:-:|:-:|:-:|:-:|:-:|
|MISO|--|GPIO19|GPIO37|GPIO4|
|SCK|--|GPIO18|GPIO36|GPIO3|
|MOSI|--|GPIO23|GPIO35|GPIO2|
|CSN|--|GPIO5|GPIO34|GPIO1|
|GDO0|--|GPIO15|GPIO33|GPIO0|
|GDO2|--|N/C|N/C|N/C|
|GND|--|GND|GND|GND|
|VCC|--|3.3V|3.3V|3.3V|__You can change it to any pin using menuconfig.__
__GDO0 needs to be able to use interrupts.__
__Some GPIOs cannot use interrupts.__# EBYTE SMD PCB
EBYTE's SPI module is a 1.27mm pitch SMD module.
So I designed a conversion board that converts from 1.27mm pitch to 2.54mm pitch.
You can order the PCB yourself using the publicly available Gerber files.You can download gerbers file from [here](https://www.pcbway.com/project/shareproject/EBYTE_SPI_LoRa_module_pitch_converter_6c8c2ec2.html).
You can repeat my order from [here](https://www.pcbway.com/project/shareproject/EBYTE_SPI_LoRa_module_pitch_converter_6c8c2ec2.html).
# Communication with another library
Basically, communication between applications with different register values is not guaranteed.
These settings may differ.
- Base frequency and channel spacing frequency
- Packet format configuration
- Manchester encoding configuration
- Wireless modulation method
- The data rate used when transmitting
- The data rate expected in receiveYou need to use [this](https://github.com/veonik/arduino-cc1101) when communicating with the Arduino environment.
Communication with other libraries is not guaranteed.# How to use this component in your project
Create idf_component.yml in the same directory as main.c.
```
YourProject --+-- CMakeLists.txt
+-- main --+-- main.c
+-- CMakeLists.txt
+-- idf_component.yml
```Contents of idf_component.yml.
```
dependencies:
nopnop2002/cc1101:
path: components/cc1101/
git: https://github.com/nopnop2002/esp-idf-cc1101.git
```When you build a projects esp-idf will automaticly fetch repository to managed_components dir and link with your code.
```
YourProject --+-- CMakeLists.txt
+-- main --+-- main.c
| +-- CMakeLists.txt
| +-- idf_component.yml
+-- managed_components ----- nopnop2002__cc1101
```# Comparison of cc2500 and cc1101
||cc2500|cc1101|
|:-:|:-:|:-:|
|Manufacturer|Texas Instrument|Texas Instrument|
|Frequency|2.4GHz|315/433/868/915MHz|
|Maximum Payload|64Byte|64Byte|
|FiFo for reception|64Byte*1|64Byte*1|
|FiFo for transmission|64Byte*1|64Byte*1|
|CRC Length|16bits|16bits|
|Acknowledgement Payload|No|No|
|Available Modulation format|2-FSK/GFSK/OOK/MSK|2-FSK/4-FSK/GFSK/ASK/OOK/MSK|# Comparison of nRF905, cc1101 and si4432
||nRF905|cc1101|si4432|
|:-:|:-:|:-:|:-:|
|Manufacturer|Nordic Semiconductor|Texas Instrument|Silicon Labs|
|Frequency|433/868/915MHz|315/433/868/915MHz|315/433/868/915MHz|
|Maximum Payload|32Byte|64Byte|64Byte|
|FiFo for reception|32Byte*1|64Byte*1|64Byte*1|
|FiFo for transmission|32Byte*1|64Byte*1|64Byte*1|
|CRC Length|8/16bits|16bits|8/16bits|
|Acknowledgement Payload|No|No|No|
|Available Modulation format|GFSK|2-FSK/4-FSK/GFSK/ASK/OOK/MSK|FSK/GFSK/OOK|- GFSK : Gaussian shaped Frequency Shift Keying
- FSK : Frequency Shift Keying
- 2-FSK : Binary Frequency Shift Keying
- 4-FSK : Quaternary Frequency Shift Keying
- ASK : Amplitude Shift Keying
- OOK : On-Off Keying
- MSI : Minimum Shift Keying