Basic Features
(1) ISM and SRD frequency bands of 2400-2483.5 MHz
(2) Maximum operating rate of 500 kbps, supporting 2-FSK, GFSK, and MSK modulation methods
(3) High sensitivity (-101 dBm at 10 Kbps 1%)
(4) Built-in hardware CRC error detection and point-to-multipoint communication address control
(5) Low current consumption (13.3 mA in RX)
(6) Programmable output power control, up to 1 dBm for all supported frequencies
(7) Supports low-power electromagnetic wave activation function
(8) Supports automatic channel access (CCA) before transmission, i.e., carrier sensing system
(9) Suitable frequency hopping system enabled by a fast frequency-changing synthesizer
(10) The module can be addressed via software, making programming very convenient
(11) Standard DIP spacing interface, convenient for embedded applications
(12) Separate 64-byte RX and TX data FIFO
WOR Function: To save energy, RF chips typically use sleep mode. However, information may be lost during sleep. The CC2500’s WOR (Wakeup-on-Radio) function effectively prevents this. The WOR function ensures that the chip periodically wakes up from deep sleep to check for surrounding signals without requiring CPU interruption. If a data packet is successfully received, the chip can output an interrupt signal to the MCU for reading.
RSSI and LQI Functions: RSSI reflects the received signal strength, while LQI reflects the quality of the signal connection. Both can be obtained by reading the chip’s registers. Although LQI can determine connection quality, it may vary with different modulation methods. RSSI is a good parameter for judging the distance between two nodes. After reading the value from the RSSI register, a series of conversions is needed to obtain the received strength value.
CCA Function: CCA (Clear Channel Assessment) indicates whether the current channel is idle. Its function is similar to CSMA. When the chip is about to switch to transmission mode, it first checks the channel; it will only enter transmission mode if the channel is idle; otherwise, it will remain in the original mode or switch to another mode as programmed.
Typical Application Scenarios
Wireless remote control, wireless mouse, wireless keyboard;
Industrial wireless control, automated data collection systems;
Wireless sensors, wireless electronic tags, remote-controlled toys;
Wireless automatic meter reading for residential meters such as water, gas, heat, and electricity;
The CC2420 is the first RF transceiver launched by Chipcon (acquired by TI) that complies with the 2.4GHz IEEE802.15.4 standard. This device includes numerous features and is the first RF device suitable for ZigBee products. It is based on SmartRF 03 technology, manufactured using 0.18um CMOS process, requiring very few external components, operating in the 2400-2483.5 MHz ISM band, and consists of a fully integrated frequency modulator, a receiver with a demodulator, a power amplifier, a crystal oscillator, and a regulator. It can automatically generate preambles, and CRC can be easily programmed and configured via the SPI interface, with low current consumption. The performance is stable and power consumption is extremely low. The selectivity and sensitivity index of the CC2420 ensure the effectiveness and reliability of short-distance communication. Wireless communication devices developed using this chip support data transmission rates of up to 250 kbps and can achieve fast networking in a multipoint-to-multipoint configuration.
Basic Features:
(1) Operates in the ISM and SRD frequency bands of 2400-2483.5 MHz.
– Uses direct sequence spread spectrum.
– Operating rate of 250 kbps, chip rate of 2 MChip/s.
– Uses O-QPSK modulation method.
– High sensitivity (-95 dBm).
– Low current consumption (RX: 13.3 mA, TX: 17.4 mA).
– Strong resistance to adjacent channel interference (39 dB)
– Internally integrated with VCO, LNA, PA, and power rectifier.
– Operates on low voltage supply (2.1-3.6V).
– Programmable output power control.
(2) IEEE802.15.4-2003 standard MAC layer hardware support.
– Automatic generation and detection of preamble and synchronization fields.
– Automatic generation and detection of CRC-16.
– Idle channel detection.
– Energy detection, received signal strength, and link quality indication.
– MAC layer security protection (CTR, CBC-MAC, CCM) support.
(3) Uses a 4-wire SPI standard interface, convenient for MCU configuration.
(4) Independent 128-byte RX and 128-byte TX data FIFO.
Typical Application Scenarios:
Wireless sensor networks
Residential and building (smart home) control
Wireless data collection and control for industrial instruments
Consumer electronics such as wireless mouse, wireless keyboard, and wireless toys
Wireless access control, logistics tracking, warehouse inspection, etc. for RFID active electronic tags
Program Reference Design
With the CC2420 module, there is no need to master any specialized wireless or high-frequency theory; readers only need a basic understanding of C programming. You can refer to the official CC2420 manual or seek technical support from us.
Additionally, to facilitate user development, we provide a series of supporting evaluation kits to ensure product development, significantly accelerating wireless application development and avoiding unnecessary pitfalls. Below are some relevant code snippets from the example program.
CC2420 Register Read/Write Configuration
The CC2420 communicates with the microcontroller via the SPI interface, so it is essential to understand the SPI interface first. The standard SPI peripheral serial interface consists of four lines:
MOSI Master Out Slave In (Master write operation)
MISO Master In Slave Out (Master read operation)
SCK Serial clock signal, controlled by the master
CSN Chip select signal, active low
SPI Read Operation Code
uint8 SPI_Read(void)
{
uint8 i, rxdata;
rxdata = 0x00;
for (i = 0; i < 8; i++)
{
rxdata = rxdata << 1;
SCLK_ON();
if (MISO_IN)
{
rxdata |= 0x01;
}
else
{
rxdata &= ~0x01;
}
SCLK_OFF();
}
return rxdata;
}
SPI Write Operation Code
void SPI_Write(uint8 txdata)
{
uint8 i;
for (i = 0; i < 8; i++)
{
if (txdata & 0x80)
{
MOSI_ON();
}
else
{
MOSI_OFF();
}
SCLK_ON();
txdata = txdata << 1;
SCLK_OFF();
}
}
CC2420 Configuration Register Read Operation
uint16 CC2420_ReadReg(uint8 addr)
{
uint16 value;
CSN_OFF();
SPI_Write(addr | REG_READ);
value = SPI_Word_Read();
CSN_ON();
return value;
}
CC2420 Configuration Register Write Operation
void CC2420_WriteReg(uint8 addr, uint16 value)
{
CSN_OFF();
SPI_Write(addr | REG_WRITE);
SPI_Word_Write(value);
CSN_ON();
}
CC2420 RAM Read Operation
uint8 CC2420_RAM_Read(uint8 addr, uint8 block)
{
uint8 value;
CSN_OFF();
SPI_Write(addr | RAM);
SPI_Write((block << 6) | RAM_READ);
value = SPI_Read();
CSN_ON();
return value;
}
CC2420 RAM Write Operation
void CC2420_RAM_Write(uint8 addr, uint8 block, uint8 value)
{
CSN_OFF();
SPI_Write(addr | RAM);
SPI_Write((block << 6) | RAM_WRITE);
SPI_Write(value);
CSN_ON();
}
CC2420 Initialization
void CC2420_Init(void)
{
RESET_OFF();
delay_ms(10);
RESET_ON();
delay_ms(10);
CC2420_Command(CMD_SXOSCON);
delay_ms(10);
CC2420_PSDU[1] =
(PAN_ID_COMPRESSION << 6) | (ACKNOWLEDGMENT_REQUEST << 5) |
(FRAME_PENDING << 4) | (SECURITY_ENABLE << 3) | (FRAME_TYPE_DATA << 0);
CC2420_PSDU[2] =
(SOURCE_ADDRESSING_MODE << 6) | (FRAME_VERSION << 4) |
(DEST_ADDRESSING_MODE << 2);
CC2420_PSDU[3] = SEQUENCE_NUMBER;
CC2420_PSDU[4] = CC2420_Destination_PANID[0];
CC2420_PSDU[5] = CC2420_Destination_PANID[1];
CC2420_PSDU[6] = CC2420_Destination_IEEEAddr[0];
CC2420_PSDU[7] = CC2420_Destination_IEEEAddr[1];
CC2420_PSDU[8] = CC2420_Destination_IEEEAddr[2];
CC2420_PSDU[9] = CC2420_Destination_IEEEAddr[3];
CC2420_PSDU[10] = CC2420_Destination_IEEEAddr[4];
CC2420_PSDU[11] = CC2420_Destination_IEEEAddr[5];
CC2420_PSDU[12] = CC2420_Destination_IEEEAddr[6];
CC2420_PSDU[13] = CC2420_Destination_IEEEAddr[7];
CC2420_PSDU[14] = CC2420_Source_PANID[0];
CC2420_PSDU[15] = CC2420_Source_PANID[1];
CC2420_RAM_Write(RAM_PANID, 2, CC2420_Source_PANID[0]);
CC2420_RAM_Write(RAM_PANID + 1, 2, CC2420_Source_PANID[1]);
CC2420_PSDU[16] = CC2420_Source_IEEEAddr[0];
CC2420_PSDU[17] = CC2420_Source_IEEEAddr[1];
CC2420_PSDU[18] = CC2420_Source_IEEEAddr[2];
CC2420_PSDU[19] = CC2420_Source_IEEEAddr[3];
CC2420_PSDU[20] = CC2420_Source_IEEEAddr[4];
CC2420_PSDU[21] = CC2420_Source_IEEEAddr[5];
CC2420_PSDU[22] = CC2420_Source_IEEEAddr[6];
CC2420_PSDU[23] = CC2420_Source_IEEEAddr[7];
CC2420_RAM_Write(RAM_IEEEADR, 2, CC2420_Source_IEEEAddr[0]);
CC2420_RAM_Write(RAM_IEEEADR + 1, 2, CC2420_Source_IEEEAddr[1]);
CC2420_RAM_Write(RAM_IEEEADR + 2, 2, CC2420_Source_IEEEAddr[2]);
CC2420_RAM_Write(RAM_IEEEADR + 3, 2, CC2420_Source_IEEEAddr[3]);
CC2420_RAM_Write(RAM_IEEEADR + 4, 2, CC2420_Source_IEEEAddr[4]);
CC2420_RAM_Write(RAM_IEEEADR + 5, 2, CC2420_Source_IEEEAddr[5]);
CC2420_RAM_Write(RAM_IEEEADR + 6, 2, CC2420_Source_IEEEAddr[6]);
CC2420_RAM_Write(RAM_IEEEADR + 7, 2, CC2420_Source_IEEEAddr[7]);
CC2420_WriteReg(REG_MDMCTRL0, CCA_HYST | CCA_MODE | PREAMBLE_LENGTH | AUTOCRC | ADR_DECODE);
CC2420_WriteReg(REG_SYNCWORD, SYNCWORD);
CC2420_WriteReg(REG_SECCTRL0, 0);
CSN_OFF();
SPI_Write(REG_RXFIFO | REG_READ);
SPI_Read();
CSN_ON();
CC2420_Command(CMD_SFLUSHRX);
CC2420_Command(CMD_SFLUSHTX);
delay_ms(10);
}
CC2420 FIFO Sending Process FIFO Write Data Operation
void CC2420_WriteTXFIFO(void)
{
uint8 i;
CC2420_Command(CMD_SFLUSHTX);
CSN_OFF();
SPI_Write(REG_TXFIFO | REG_WRITE);
SPI_Write(CC2420_PSDU[0]);
for(i = 0; i < CC2420_PSDU[0]; i++)
{
SPI_Write(CC2420_PSDU[1 + i]);
}
CSN_ON();
}
FIFO Data Sending Operation
void CC2420_TxPacket(void)
{
CC2420_Command(CMD_SRFOFF);
CC2420_Command(CMD_STXON);
while(!SFD_IN);
while(SFD_IN);
}
CC2420 FIFO Receiving Process Receive Mode Setting
void CC2420_SetRxMode(void)
{
CC2420_Command(CMD_SRFOFF);
CC2420_Command(CMD_SRXON);
}
FIFO Receive Data
uint8 CC2420_RxPacket(void)
{
if((!SFD_IN) && (FIFO_IN))
{
return TRUE;
}
return FALSE;
}
Read FIFO Data After Receiving Data
void CC2420_ReadRXFIFO(void)
{
uint8 i;
CSN_OFF();
SPI_Write(REG_RXFIFO | REG_READ);
CC2420_PSDU[0] = SPI_Read();
for(i = 0; i < CC2420_PSDU[0]; i++)
{
CC2420_PSDU[1 + i] = SPI_Read();
}
CSN_ON();
CC2420_Command(CMD_SFLUSHRX);
}
Considerations for Wireless Applications
(1) The VCC voltage range for the wireless module is between 1.8V-3.6V; it must not exceed this range, as exceeding 3.6V will damage the module. A recommended voltage is around 3.3V.
(2) Except for the power VCC and ground pins, all other pins can be directly connected to the ordinary 51 microcontroller IO ports without level shifting. Of course, it is more suitable for microcontrollers around 3V.
(3) Microcontrollers without SPI hardware can also control this module by simulating SPI with ordinary microcontroller IO ports; it does not require the microcontroller’s actual serial port intervention, just ordinary microcontroller IO ports are sufficient, although using a serial port is also possible. The module should be connected according to the interface prompts and the motherboard’s logical connections.
(4) Standard DIP pins are used; if other packaging interfaces or forms are needed, please contact us for customization.
(5) Any microcontroller can achieve data transmission and reception control for the wireless module, and it can be ported based on the programs we provide, combined with the microcontroller model you are proficient in;
(6) Explanation of channel spacing: To ensure that two modules can transmit simultaneously without interfering with each other, the channel spacing should differ by at least 1 MHz; this must be noted during networking; otherwise, interference will occur on the same frequency.
(7) Actual users may use other familiar microcontrollers as the main control chip, so it is recommended to pay attention to the following four points during porting:
A: Ensure that the IO is set as input/output and must be set as digital IO;
B: Pay attention to the register settings related to the used IO, especially for IO with external interrupts and AD functions; the related registers must be set correctly;
C: During debugging, first write the configuration word, then control data transmission and reception
D: Pay attention to the working mode switching time
To facilitate better learning, Changxue Electronics has specially added a public account for microcontrollers and EDA, pushing relevant knowledge daily, hoping to assist your learning!
Changxue Microcontroller WeChat ID: changxuemcu
Focusing on microcontrollers, we will learn key knowledge points and experience skills related to microcontrollers together. Join us to learn!
Changxue EDA WeChat ID: changxueeda
Follow us for instant sharing of the latest EDA technology information and key knowledge points, experience skills, and easy daily learning of EDA technology.