2447 views|0 replies

6609

Posts

0

Resources
The OP
 

Understanding CC2500 Wireless Module [Copy link]

The CC2500 chip is an ultra-low power, low-cost wireless transceiver module launched by TI (formerly Chipcon acquired by TI). Its carrier frequency range is adjustable from 2.400GHz to 2.483GHz, and can be used to achieve multi-channel communication. It supports multiple modulation modes, including FSK, GFSK, OOK and MSK, and the data transmission rate can reach up to 500kb/s. CC2500 also provides additional hardware support for functions such as packet processing, data buffering, pulse transmission, idle channel assessment, connection quality indication and electromagnetic wake-up. It has four main states: receive (RX), transmit (TX), idle (IDLE) and sleep (SLEEP)Basic Features
(1) 2400-2483.5 MHz ISM and SRD bands
(2) Maximum operating rate of 500kbps, supporting 2-FSK, GFSK and MSK modulation
(3) High sensitivity (-101dBm at 10Kbps 1%)
(4) Built-in hardware CRC Error detection and point-to-multipoint communication address control
(5) Low current consumption (13.3mA in RX)
(6) Programmable output power up to 1dBm for all supported frequencies
(7) Supports low-power electromagnetic wave activation function
(8) Supports automatic channel access clearance (CCA) before transmission, i.e., carrier sense system
(9) Fast frequency change synthesizer brings suitable frequency hopping system
(10) The module can be addressed by software, which is very convenient for software programming
(11) Standard DIP spacing interface, convenient for embedded applications
(12) Separate 64-byte RX and TX data FIFO
WOR function: In order to save power, RF chips usually use sleep mode. The chip will inevitably lose information when it is in sleep mode. The WOR (Wakeup-on-Radio) function of CC22500 can avoid this well. The WOR function ensures that the chip wakes up periodically during deep sleep to detect whether there is a signal around. This process does not require CPU interruption. If a data packet is successfully received, the chip can notify the MCU to read it through the pin output interrupt. RSSI and LQI functions: RSSI reflects the strength of the received signal, and LQI reflects the connection quality of the signal. Both can be obtained by reading the chip register. Although LQI can judge the connection quality, it will vary depending on the modulation method. RSSI is a good parameter for judging the distance between two nodes. After reading the value from the RSSI register, we need to perform a series of conversions to obtain the receiving strength value. CCA function: CCA (Clear Channel Assessment) can indicate whether the current channel is idle. Its function is similar to CSMA. When the chip is about to switch to the sending mode, it will first check the channel. Only when the channel is idle will it enter the sending mode, otherwise it will stay in the original mode or enter other modes by programming.
Typical Applications
Wireless remote control, wireless mouse, wireless keyboard; Industrial wireless control, automatic data acquisition system; Wireless sensors, wireless electronic tags, remote control toys; Wireless automatic meter reading for water, gas, heat, electricity and other residential meters;
CC2420 is the first RF transceiver that complies with the 2.4GHz IEEE802.15.4 standard launched by Chipcon (acquired by TI). This device includes many functions and is the first RF device suitable for ZigBee products. It is based on SmartRF 03 technology and is made of 0.18um CMOS technology. It requires very few external components and works in the ISM band of 2400-2483.5MHZ. It consists of a fully integrated frequency modulator, a receiver with demodulator, a power amplifier, a crystal oscillator and a regulator. It can automatically generate preamble codes, and CRC can be easily programmed and configured through the SPI interface. It has low current consumption. It has stable performance and extremely low power consumption. The selectivity and sensitivity index of CC2420 can ensure the effectiveness and reliability of short-distance communication. Wireless communication equipment developed using this chip supports data transmission rates up to 250kbps and can achieve multi-point to multi-point rapid networking.
Basic features:
(1) Works in the ISM and SRD bands of 2400-2483.5 MHz.
-Adopts direct sequence spread spectrum.
-Working rate 250kbps, chip rate 2 MChip/s.
-Uses O-QPSK modulation.- High sensitivity (-95dBm). - Lower current consumption (RX: 13.3 mA TX: 17.4 mA).
-Strong anti-adjacent channel interference capability (39dB)
-Internally integrated with VCO, LNA, PA and power rectifier.
-Low voltage power supply (2.1~3.6V).
-Output power is programmable and controllable.
(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) Adopt 4-wire SPI standard interface, easy to configure MCU.
(4) Independent 128-byte RX and 128-byte TX data FIFO.
Typical application scenarios:
Wireless sensor networkResidential and building (smart home)Control of industrial instrumentationWireless data acquisition and controlWireless mouse, wireless keyboard, wireless toys and other consumer electronics
Wireless access control, logistics tracking, warehouse inspection and other RFID active electronic tags
Program Reference Design
To use the CC2420 module, you do not need to master any professional wireless or high-frequency theories. Readers only need to have a certain foundation in C language programming. You can refer to the CC2420 official manual or seek technical support from us.
At the same time, to facilitate user development, we provide a series of supporting evaluation kits to escort product development, greatly accelerate wireless application development, and avoid unnecessary misunderstandings. The following are some relevant code segments in the example program.
CC2420Register Read and Write Configuration
CC2420 communicates with the microcontroller through the SPI interface, so you must first understand the SPI interface. The standard SPI peripheral serial interface consists of four lines:
MOSI master output slave input (master write operation)
MISO master input slave output (master read operation)
SCK serial clock signal, controlled by the host
CSN chip select signal, low level is valid
SPI read operation code
uint8 SPI_Read(void)
{
uint8 i,rxdata;
rxdata = 0x00;
[align=left ] for (i = 0;i < 8;i++)
{
rxdata = rxdata<<1;
SCLK_ON();
if (MISO_IN)
{
[ size=3] rxdata |= 0x01;
}
else
[size= 3] {
rxdata &= ~0x01;
}
SCLK_OFF();
}
return rxdata;
}
[color =#000000]SPIWrite operation code
void SPI_Write(uint8 txdata)
{
[size =3] uint8 i;
for (i = 0;i < 8;i++)
{
[ align=left] if (txdata&0x80)
{
[size=3 ] MOSI_ON();
}
else
{
MOSI_OFF();
}
SCLK_ON();
txdata = txdata<<1;
SCLK_OFF();
[ align=left] }
}
[color= #000000]CC2420Configuration register read operation
uint16 CC2420_ReadReg(uint8 addr)
{
[size =3] uint16value;
CSN_OFF();
[align=left ] SPI_Write(addr|REG_READ);
value = SPI_Word_Read();
[align=left ] CSN_ON();
return value;
}
[color =#000000]CC2420Configuration register write operation
void CC2420_WriteReg(uint8 addr, uint16 value)
{
[size =3] CSN_OFF();
SPI_Write(addr|REG_WRITE);
SPI_Word_Write(value); [/ align]
CSN_ON();
}
[color=# 000000]CC2420 RAM Read operation
uint8 CC2420_RAM_Read(uint8 addr,uint8 block)
{
[ align=left] uint8 value;
CSN_OFF();
[align=left ] SPI_Write(addr|RAM);
SPI_Write((block<<6)|RAM_READ);[/color ]
value = SPI_Read();
CSN_ON();
[align =left] return value;
}
[color =#000000]CC2420 RAM write operation
void CC2420_RAM_Write(uint8 addr,uint8 block,uint8 value)
{
[ size=3] CSN_OFF();
SPI_Write(addr|RAM);
SPI_Write((block<<6)|RAM_WRITE);[/color ]
SPI_Write(value);
CSN_ON();
}
[color=# 000000]CC2420Initialization
void CC2420_Init(void)
{
RESET_OFF();
delay_ms(10);
[ align=left] RESET_ON();
delay_ms(10);
[ align=left] CC2420_Command(CMD_SXOSCON);
delay_ms(10);
CC2420_PSDU[ 1 ] =
(PAN_ID_COMPRESSION<<6)|(ACKNOWLEDGMENT_REQUEST<<5)|[/size ]
[align=lef t](FRAME_PENDING<<4)|(SECURITY_ENABLE<<3)|(FRAME_TYPE_DATA<<0);[align=left ] CC2420_PSDU[2] =
(SOURCE_ADDRESSING_MODE<<6)|(FRAME_VERSION<<4)|[/size ][/a lign]
(DEST_ADDRESSING_MODE<<2);
[color= #000000] CC2420_PSDU[ 3 ] = SEQUENCE_NUMBER;
CC2420_PSDU[ 4 ] = CC2420_Destination_PANID[0];[ /size]
CC2420_PSDU[ 5 ] = CC2420_Destination_PANID[1];
CC2420_PSDU[ 6 ] = CC2420_Destination_IEEEAddr[0];[ /size]
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];[/size ]
CC2420_PSDU[11] = CC2420_Destination_IEEEAddr[5];
CC2420_PSDU[12] =CC2420_Destination_IEEEAddr[6];
CC2420_PSDU[13] = CC2420_Destination_IEEEAddr[7];[/size ]
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];[/ size]
CC2420_PSDU[17] = CC2420_Source_IEEEAddr[1];
CC2420_PSDU[18] = CC2420_Source_IEEEAddr[2];
CC2420_PSDU[19] = CC2420_Source_IEEEAddr[3];[/size ]
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];[/size ]
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();
[align= left] SPI_Write(REG_RXFIFO|REG_READ);
SPI_Read();
[ size=3] CSN_ON();
CC2420_Command(CMD_SFLUSHRX);
CC2420_Command(CMD_SFLUSHTX);
delay_ms(10);
}
[size=3 ]CC2420 FIFOSending processFIFOWrite data operation
void CC2420_WriteTXFIFO(void)
{
uint8 i;
CC2420_Command(CMD_SFLUSHTX);
[align= left] CSN_OFF();
SPI_Write(REG_TXFIFO|REG_WRITE);
[align= left] SPI_Write(CC2420_PSDU[0]);
for(i=0;i" align][size="3][font=Times" cc2420_command(cmd_sflushrx);="" cc2420_command(cmd_srfoff);[="" cc2420_command(cmd_srxon);[="" cc2420_command(cmd_stxon);[="" cc2420_psdu[0]="SPI_Read();" cc2420_psdu[1+i]="SPI_Read();
" cc2420_readrxfifo(void)[="" cc2420_rxpacket(void)[="" cc2420_setrxmode(void)[="" cc2420_txpacket(void)[="" color][="" csn_off();="" csn_on();="" div="" false;[="" fifo[="" font]接收数据[="" font]接收流程接收模式设置[="" font]数据[="" font]数据发送操作[="" for(i="0;i<CC2420_PSDU[0];i++)
" i;[="" if((!sfd_in)&&(fifo_in))[="" new="" return="" roman]fifo[="" size][="" size][align="left]void" spi_write(cc2420_psdu[1+i]);[="" spi_write(reg_rxfifo|reg_read);="" true;[="" uint8="" while(!sfd_in);[="" while(sfd_in);[="" {[="" }="" }[="" 任何单片机都可实现对无线模块的数据收发控制,并可根据我们提供的程序,然后结合自己擅长的单片机型号进行移植;[="" 实际用户可能会应用其他自己熟悉的单片机做为主控芯片,所以,建议大家在移植时注意以下4点:[="" 无线模块的vcc电压范围为="" 标准dip插针,如需要其他封装接口,或其他形式的接口,可联系我们定做。[="" 硬件上面没有spi的单片机也可以控制本模块,用普通单片机io口模拟spi不需要单片机真正的串口介入,只需要普通的单片机io口就可以了,当然用串口也可以了。模块按照接口提示和母板的逻辑地连接起来[="" 除电源vcc和接地端,其余脚都可以直接和普通的51单片机io口直接相连,无需电平转换。当然对3v左右的单片机更加适用了。[="" 频道的间隔的说明:实际要想2个模块同时发射不相互干扰,两者频道间隔应该至少相差1mhz,这在组网时必须注意,否则同频比干扰。[="">
Understanding CC2500 Wireless Module


This post is from RF/Wirelessly
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list