Skip to content

Commit a63e782

Browse files
authored
Update README.md
1 parent 613c4d4 commit a63e782

File tree

1 file changed

+47
-41
lines changed

1 file changed

+47
-41
lines changed

README.md

+47-41
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ If the module lays with the antenna connectors to the top, on the lower connecti
1818
+ GDO0 (unused)
1919
+ CS (or CSN)
2020

21-
The modules usually support voltages from 1.8V to 3.6V, so please use a level converter when connecting to a 5V CPU board. Also, be careful when soldering the connections, I have grilled several **CC1101** modules...
21+
> [!IMPORTANT]
22+
> The modules usually support voltages from 1.8V to 3.6V, so please use a level converter when connecting to a 5V CPU board.
23+
24+
Also, be careful when soldering the connections, I have grilled several **CC1101** modules...
2225

2326
### Processor boards
2427
**Arduino Pro Mini (ATMega328p)**
@@ -45,10 +48,12 @@ The modules usually support voltages from 1.8V to 3.6V, so please use a level co
4548
+ COPI 11
4649
+ CS 10
4750

48-
For ESP32 and (to a limited extent) ESP8266 support custom SPI pinout. These differnt configurations need to be hardcoded in the library though. Later versions may support user-specified SPI configurations.
51+
52+
> [!NOTE]
53+
> ESP32 and (to a limited extent) ESP8266 support custom SPI pinout. If, for some reason, you need a custom pin configurations, you have to edit the [library header file](src/SmartCC1101.h) directly for the time being. Later versions may support user-specified SPI configurations.
4954
5055
## Programming
51-
The following code implements a simple sender and is available in the examples folder.
56+
The following code implements a simple [sender](./examples/Sender/Sender.ino) and is available in the [examples folder](./examples/).
5257

5358
The settings are not limited to the `setup()` and may be changed anytime in the `loop()` if needed.
5459

@@ -68,10 +73,10 @@ void setup() {
6873
delay(20000);
6974
}
7075

71-
SmartCC1101.setSymbolRate(100000); // Set the Data Rate in Baud. Value from 20 to 1621830 Default is 115051 Baud
72-
SmartCC1101.setManchester(true); // Enables Manchester encoding/decoding. false = Disable (default), true = Enable.
73-
SmartCC1101.setWhiteData(true); // Turn data whitening on / off. false = Whitening off (default). true = Whitening on.
74-
SmartCC1101.setCRCCheck(true); // true = CRC calculation in TX and CRC check in RX enabled. false = CRC disabled for TX and RX (default).
76+
SmartCC1101.setSymbolRate(100000); // Set the Data Rate to 10kBaud
77+
SmartCC1101.setManchester(true); // Enable Manchester encoding/decoding.
78+
SmartCC1101.setWhiteData(true); // Turn data whitening on.
79+
SmartCC1101.setCRCCheck(true); // CRC calculation in TX and CRC check in RX enabled.
7580
}
7681

7782
void loop() {
@@ -80,13 +85,13 @@ void loop() {
8085
// Send data. Returns when data is actually sent.
8186
SmartCC1101.sendData(messageText);
8287

83-
// Wait a moment untill next data sent.
88+
// Wait for a second untill next data sent.
8489
delay(1000);
8590
}
8691

8792
```
8893

89-
The corresponding receiver (also available in the examples folder):
94+
The corresponding [receiver](./examples/Receiver/Receiver.ino) (also available in the [examples folder](./examples/)):
9095

9196
```C++
9297

@@ -104,19 +109,19 @@ void setup() {
104109
delay(20000);
105110
}
106111

107-
SmartCC1101.setRXBandWitdth(SmartCC1101::bw_812kHz); // Set the Receive Bandwidth in kHz. Possible values: bw_58kHz = 58kHz, bw_68kHz, bw_81kHz, bw_102kHz,bw_116kHz, bw_135kHz, bw_162kHz, bw_203kHz (default), bw_232kHz, bw_270kHz, bw_325kHz, bw_406kHz, bw_464kHz, bw_541kHz, bw_650kHz, bw_812kHz = 812kHz
108-
SmartCC1101.setSymbolRate(100000); // Set the Data Rate in Baud. Value from 20 to 1621830 Default is 115051 Baud
109-
SmartCC1101.setManchester(true); // Enables Manchester encoding/decoding. false = Disable (default), true = Enable.
110-
SmartCC1101.setWhiteData(true); // Turn data whitening on / off. false = Whitening off (default). true = Whitening on.
111-
SmartCC1101.setCRCCheck(true); // true = CRC calculation in TX and CRC check in RX enabled. false = CRC disabled for TX and RX (default).
112+
SmartCC1101.setRXBandWitdth(SmartCC1101::bw_812kHz); // Set the Receive Bandwidth to 812 kHz
113+
SmartCC1101.setSymbolRate(100000); // Set the Data Rate to 10 kBaud
114+
SmartCC1101.setManchester(true); // Enables Manchester encoding/decoding.
115+
SmartCC1101.setWhiteData(true); // Turn data whitening on.
116+
SmartCC1101.setCRCCheck(true); // CRC calculation in TX and CRC check in RX enabled.
112117
}
113118

114119

115120
void loop() {
116121
uint8_t buffer[61]{ 0 }; // buffer for the data received by **CC1101**
117122

118-
int len = SmartCC1101.receiveData(buffer);
119-
// len will be 0 if nothing is yet received.
123+
int len = SmartCC1101.receiveData(buffer); // len will be 0 if nothing is yet received.
124+
120125
if (len > 0) {
121126
Serial.print(len);
122127
Serial.println(" bytes received.");
@@ -132,26 +137,25 @@ void loop() {
132137

133138
// check if crc is correct
134139
if (CRC) {
135-
Serial.println("CRC ok. RSSI: ");
136-
Serial.print(RSSI);
137-
Serial.print("dB, LQI ");
138-
Serial.println(LQI);
140+
Serial.println("CRC ok.");
139141
Serial.println("Data:");
140142
Serial.println((char *)buffer);
141143
} else {
142-
Serial.print("CRC Error. RSSI: ");
143-
Serial.print(RSSI);
144-
Serial.print("dB, LQI ");
145-
Serial.println(LQI);
144+
Serial.println("CRC Error.");
146145
}
146+
Serial.println("RSSI: ");
147+
Serial.print(RSSI);
148+
Serial.print("dB, LQI ");
149+
Serial.println(LQI);
147150
}
148151
}
149152

150153
```
151154

152155
## Function reference
156+
If you need more detailed information, please check the [CC1101 data sheet](https://www.ti.com/lit/ds/symlink/cc1101.pdf).
153157

154-
`void init(void)` must be called prior to using any other function. Will establish the necessary setup of the **CC1101** chip. Only exception: `getCC1101()` may be called prior to `init()`.
158+
### Functions in alphabetic order:
155159

156160
`bool checkCRC(void)` Check if CRC is correct. Returns `true` if CRCs match in last transmission. Only meaningful after data is received via `receiveData()`.
157161

@@ -161,6 +165,8 @@ void loop() {
161165

162166
`int8_t getRSSI(void)` Received Signal Strength Indicator. The value is the estimated signal strength in dBm. When called after data is received via `receiveData()`. RSSI corresponds to the data received. If called intermittently, returns the current signal strength.
163167

168+
`void init(void)` must be called prior to using any other function. Will establish the necessary setup of the **CC1101** chip. Only exception: `getCC1101()` may be called prior to `init()`.
169+
164170
`uint8_t receiveData(uint8_t *rxBuffer)` Check if data is received and copy it to rxBuffer. Returns 0 if no data is received yet, transmission is in progress or CRC wrong and `void setCRC_AF(true)`. If data was received, `setRX()`must be called again.
165171

166172
`void sendData(const char *txBuffer)` Sends the zero-terminated character string pointed to. Will return when data is sent. Must be max 61 characters including the trailing 0.
@@ -177,7 +183,7 @@ void loop() {
177183
| adc_YES0BC | Address check and 0 (0x00) broadcast |
178184
| adc_YES0FFBC | Address check and 0 (0x00) and 255 (0xFF) broadcast |
179185

180-
`void setCarrierFrequency(uint32_t freq)` Set tranmsision frequency in Hz. Default = 868.35 MHz). The **CC1101** can use the frequenciy ranges 300-348 MHZ, 387-464MHZ and 779-928MHZ.
186+
`void setCarrierFrequency(uint32_t freq)` Set tranmsision frequency in Hz. Default = 868.35 MHz). The **CC1101** can use the frequenciy ranges 300-348 MHZ, 387-464 MHZ and 779-928 MHZ.
181187
> [!WARNING]
182188
> Please respect local regulations.
183189
@@ -263,21 +269,21 @@ void loop() {
263269
`void setRXBandWitdth(rx_BandWidth bw)` Set the Receive Bandwidth. Value can be cosen from predefined list of values:
264270
| Bandwidth | Value |
265271
|----------|---------|
266-
| 58KHz | bw_58kHz |
267-
| 68kHz | bw_68kHz |
268-
| 81kHz | bw_81kHz |
269-
| 102kHz | bw_102kHz |
270-
| 116kHz | bw_116kHz |
271-
| 135kHz | bw_135kHz |
272-
| 203kHz | bw_203kHz (default) |
273-
| 232kHz | bw_232kHz |
274-
| 270kHz | bw_270kHz |
275-
| 325kHz | bw_325kHz |
276-
| 406kHz | bw_406kHz |
277-
| 464kHz | bw_464kHz |
278-
| 541kHz | bw_541kHz |
279-
| 650kHz | bw_650kHz |
280-
| 812kHz | bw_812kHz |
272+
| 58 KHz | bw_58kHz |
273+
| 68 kHz | bw_68kHz |
274+
| 81 kHz | bw_81kHz |
275+
| 102 kHz | bw_102kHz |
276+
| 116 kHz | bw_116kHz |
277+
| 135 kHz | bw_135kHz |
278+
| 203 kHz | bw_203kHz (default) |
279+
| 232 kHz | bw_232kHz |
280+
| 270 kHz | bw_270kHz |
281+
| 325 kHz | bw_325kHz |
282+
| 406 kHz | bw_406kHz |
283+
| 464 kHz | bw_464kHz |
284+
| 541 kHz | bw_541kHz |
285+
| 650 kHz | bw_650kHz |
286+
| 812 kHz | bw_812kHz |
281287

282288
`void setSymbolRate(double symbolRate)` Data transmission rate in baud. Value from 20 to 1621830 Default is 115051 Baud.
283289
> [!IMPORTANT]

0 commit comments

Comments
 (0)