资源描述:
《无线模块cc2500的应用例程》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、无线模块CC2500的应用例程#include"fly8000.h"#include"CC2500.h"pdatauint8CC2500_TxRxBuf[1+CC2500_DATA_LEN];//CC2500_DATA_LEN=32;but61中是64;pdatauint8CC2500_TxAddr=0x01;pdatauint8CC2500_RxAddr=0x01;codePaTabel[8]={0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60};//----------------
2、----------CC2500寄存器配置---------------------------------codeCC2500_RF_SETTINGSCC2500_Config={0x0B,//IOCFG2GDO2outputpinconfiguration.0x06,//IOCFG10x06,//IOCFG0GDO0outputpinconfiguration.0x07,//FIFOTHR0xD3,//SYNC1MSB0x91,//SYNC0LSB1+CC2500_DATA_LEN,//PKTLENPacket
3、length.0x02,//PKTCTRL1Packetautomationcontrol.0x04,//PKTCTRL0Packetautomationcontrol.0x01,//ADDRDeviceaddress.0x00,//CHANNRChannelnumber.0x07,//FSCTRL1Frequencysynthesizercontrol.0x00,//FSCTRL0Frequencysynthesizercontrol.0x5D,//FREQ2Frequencycontrolword,highby
4、te.0x93,//FREQ1Frequencycontrolword,middlebyte.0xB1,//FREQ0Frequencycontrolword,lowbyte.0x2D,//MDMCFG4Modemconfiguration.0x3B,//MDMCFG3Modemconfiguration.0x73,//MDMCFG2Modemconfiguration.0x22,//MDMCFG1Modemconfiguration.0xF8,//MDMCFG0Modemconfiguration.0x47,//
5、DEVIATNModemdeviationsetting(whenFSKmodulationisenabled).0x00,//MCSM2MainRadioControlStateMachineconfiguration.0x02,//MCSM1MainRadioControlStateMachineconfiguration.0x18,//MCSM0MainRadioControlStateMachineconfiguration.0x1D,//FOCCFGFrequencyOffsetCompensationC
6、onfiguration.0x1C,//BSCFGBitsynchronizationConfiguration.0xC7,//AGCCTRL2AGCcontrol.0x00,//AGCCTRL1AGCcontrol.0xB2,//AGCCTRL0AGCcontrol.0x00,//WOREVT10x00,//WOREVT00x00,//WORCTRL0xB6,//FREND1FrontendRXconfiguration.0x10,//FREND0FrontendRXconfiguration.0xEA,//FS
7、CAL3Frequencysynthesizercalibration.0x0A,//FSCAL2Frequencysynthesizercalibration.0x00,//FSCAL1Frequencysynthesizercalibration.0x11,//FSCAL0Frequencysynthesizercalibration.0x00,//RCCTRL10x00,//RCCTRL00x59,//FSTESTFrequencysynthesizercalibration.0x00,//PTEST0x00
8、,//AGCTEST0x88,//TEST2Varioustestsettings.0x31,//TEST1Varioustestsettings.0x0B,//TEST0Varioustestsettings.};//---------------------------CC2500射频芯片初始化函数----------------------------