CC1120的问题,麻烦解答下
最近在调CC1120。
CC1120初始寄存器遇到的设置问题:
1.通过Smart RFStudio设置生成的一些寄存器值,放到代码里面不能正常通信。在433Mhz, 1200bps情况下Smart RFStudio设置生成的值为:
// Rf settings for CC1120
RF_SETTINGS code rfSettings = {
0xB0, // IOCFG3 GPIO3 IO Pin Configuration
0x06, // IOCFG2 GPIO2 IO Pin Configuration
0xB0, // IOCFG1 GPIO1 IO Pin Configuration
0x40, // IOCFG0 GPIO0 IO Pin Configuration
0x0B, // SYNC_CFG1 Sync Word Detection Configuration
0x1C, // DCFILT_CFG Digital DC Removal Configuration
0x18, // PREAMBLE_CFG1 Preamble Length Configuration
0xC6, // IQIC Digital Image Channel Compensation Configuration
0x08, // CHAN_BW Channel Filter Configuration
0x05, // MDMCFG0 General Modem Parameter Configuration
0x20, // AGC_REF AGC Reference Level Configuration
0x19, // AGC_CS_THR Carrier Sense Threshold Configuration
0xA9, // AGC_CFG1 AGC Configuration
0xCF, // AGC_CFG0 AGC Configuration
0x00, // FIFO_CFG FIFO Configuration
0x03, // SETTLING_CFG Frequency Synthesizer Calibration and Settling Configuration
0x14, // FS_CFG Frequency Synthesizer Configuration
0x20, // PKT_CFG0 Packet Configuration, Reg 0
0xFF, // PKT_LEN Packet Length Configuration
0x00, // IF_MIX_CFG IF Mix Configuration
0x22, // FREQOFF_CFG Frequency Offset Correction Configuration
0x6C, // FREQ2 Frequency Configuration [23:16]
0x80, // FREQ1 Frequency Configuration [15:8]
0x00, // FS_DIG1
0x5F, // FS_DIG0
0x40, // FS_CAL1
0x0E, // FS_CAL0
0x03, // FS_divTWO Divide by 2
0x33, // FS_DSM0 Digital Synthesizer Module Configuration, Reg 0
0x17, // FS_DVC0 Divider Chain Configuration, Reg 0
0x50, // FS_PFD Phase Frequency Detector Configuration
0x6E, // FS_PRE Prescaler Configuration
0x14, // FS_REG_div_CML
0xAC, // FS_SPARE
0xB4, // FS_VCO0 VCO Configuration, Reg 0
0x0E, // XOSC5 Crystal Oscillator Configuration, Reg 5
0x03, // XOSC1 Crystal Oscillator Configuration, Reg 1
};
2.下载官网的demo程序(CC1120 software_swrc219)看了下,多了几个关键寄存器,拷贝到我代码里,目前能正常通信,但是之前 CC1101等调试都是以Smart RFStudio生成的寄存器配置为准,不知道此份设置是否稳定?
官方的例程设置如下:
// Modem settings for test case 1 adjusted to 25kHz RXBW and 4 Byte preamble(")*/ CC1120工程中
const registerSetting_t cc112xLowDataRateRfSettings[] =
{
{CC112X_IOCFG0 ,0x06}, // Route sync signal to GPIO0
{CC112X_FS_DIG1 ,0x00},
{CC112X_FS_DIG0 ,0x5F},
{CC112X_FS_CAL0 ,0x0E},
{CC112X_FS_divTWO ,0x03},
{CC112X_FS_DSM0 ,0x33},
{CC112X_FS_DVC0 ,0x17},
{CC112X_FS_PFD ,0x50},
{CC112X_FS_PRE ,0x6E},
{CC112X_FS_REG_div_CML ,0x14},
{CC112X_FS_SPARE ,0xAC},
{CC112X_XOSC5 ,0x0E},
{CC112X_XOSC4 ,0xA0},
{CC112X_XOSC3 ,0xC7},
{CC112X_XOSC1 ,0x03},
{CC112X_ANALOG_SPARE ,0x00},
{CC112X_FIFO_CFG ,0x00},
{CC112X_DEV_ADDR ,0x00},
{CC112X_SETTLING_CFG ,0x0B},
{CC112X_FS_CFG ,0x12}, //////////////////////////////////////////////////////////////////
{CC112X_PKT_CFG2 ,0x00},
{CC112X_PKT_CFG1 ,0x05}, // Address check off and CRC check on
{CC112X_PKT_CFG0 ,0x20},
{CC112X_RFEND_CFG1 ,0x0F}, // Stay in RX after RX, No timeout for sync word search
{CC112X_RFEND_CFG0 ,0x00}, // IDle after TX, no interferring from MARC
{CC112X_SYNC3 ,0x93},/////////////////////////////////////////////////////////////////////
{CC112X_SYNC2 ,0x0B},
{CC112X_SYNC1 ,0x51},
{CC112X_SYNC0 ,0xDE},
{CC112X_SYNC_CFG1 ,0x0B},
{CC112X_SYNC_CFG0 ,0x17},
{CC112X_DEVIATION_M ,0x06}, // (4000 Hz)
{CC112X_MODCFG_DEV_E ,0x03}, // (4000 Hz)
{CC112X_DCFILT_CFG ,0x1C}, //
{CC112X_PREAMBLE_CFG1 ,0x18}, // 4" byte preamble
{CC112X_PREAMBLE_CFG0 ,0x2A}, //
{CC112X_FREQ_IF_CFG ,0x40}, // (62500 Hz)
{CC112X_IQIC ,0xC6}, //
{CC112X_CHAN_BW ,0x08}, // (25000" Hz)
{CC112X_MDMCFG1 ,0x46}, //
{CC112X_MDMCFG0 ,0x05}, //
{CC112X_DRATE2 ,0x43}, // (1200 bps)
{CC112X_DRATE1 ,0xA9}, // (1200 bps)
{CC112X_DRATE0 ,0x2A}, // (1200 bps)
{CC112X_AGC_REF ,0x20},
{CC112X_AGC_CS_THR ,0x19},
{CC112X_AGC_GAIN_ADJUST ,0x00},
{CC112X_AGC_CFG3 ,0x91},
{CC112X_AGC_CFG2 ,0x20},
{CC112X_AGC_CFG1 ,0xA9},
{CC112X_AGC_CFG0 ,0xCF},
{CC112X_PA_CFG2 ,0x7F},
{CC112X_PA_CFG1 ,0x56},
{CC112X_PA_CFG0 ,0x7C},
{CC112X_IF_MIX_CFG ,0x00},
{CC112X_FREQOFF_CFG ,0x22},
{CC112X_TOC_CFG ,0x0B},
{CC112X_SOFT_TX_DATA_CFG ,0x00}
};
3.此次调试RSSI值有误(是按照CC1101的RSSI的那套代码)不知道1120的RSSI跟之前的1101是否有大的变动?CC1120跟之前的系列低功耗方面是否也有大的变动?
麻烦Ti的工程师解决下疑问?
能否告知一下怎么是两个CC1120通信正常的?谢谢。
一个TX 一个RX,两个之间能正常进行收发的数据通信。