|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
請(qǐng)教:無(wú)線芯片cc1000的校準(zhǔn)問(wèn)題 |
| 作者:wolflet 欄目:單片機(jī) |
我的CC1000校準(zhǔn)總是失敗,不知是何原因?請(qǐng)大俠指點(diǎn) 程序如下: #define TimeOutCounter 0xFFFE CHAR CalibrateCC1000(void) { int TimeOutCounter; unsigned CHAR i=0; putsCHAR("enter CalibrateCC1000()"); WriteToCC1000Register(CC1000_PA_POW,0x00); // Turn off PA to avoid spurs // during calibration in TX mode WriteToCC1000Register(CC1000_CAL,0xA6); // Start calibration i=ReadFromCC1000Register(CC1000_CAL); myprintf("CC10000_CAL=%x",i); putsCHAR("begin CalibrateCC1000()"); // Wait for calibration complete for(TimeOutCounter=CAL_TIMEOUT; ((ReadFromCC1000Register(CC1000_CAL)&0x08)==0)&&(TimeOutCounter>0); TimeOutCounter--); putsCHAR("CalibrateCC1000() complete"); // Wait for LOCK for(TimeOutCounter=LOCK_TIMEOUT; ((ReadFromCC1000Register(CC1000_LOCK)&0x01)==0)&&(TimeOutCounter>0); TimeOutCounter--); putsCHAR("LOCK complete"); WriteToCC1000Register(CC1000_CAL,0x26); /* End calibration */ i=ReadFromCC1000Register(CC1000_CAL); myprintf("CC10000_CAL=%x",i); putsCHAR("calibrate complete"); WriteToCC1000Register(CC1000_PA_POW,PA_VALUE); /* Restore PA setting */ i=ReadFromCC1000Register(CC1000_LOCK); myprintf("CC10000_LOCK=%x",i); return ((ReadFromCC1000Register(CC1000_LOCK)&0x01)==1); } void CC1000_init(void) { CHAR callibrate_state=0; unsigned CHAR TEMP; // ResetCC1000(); // reset CC1000 WriteToCC1000Register(CC1000_MAIN,0x3A); TEMP=ReadFromCC1000Register(CC1000_MAIN); myprintf("%x",TEMP); WriteToCC1000Register(CC1000_MAIN,0x3B); TEMP=ReadFromCC1000Register(CC1000_MAIN); myprintf("%x",TEMP); delay_ms(20); // wait for 2ms //====================配置寄存器A的值,用于接收頻率433.565314 WriteToCC1000Register(CC1000_FREQ_2A,0x66) ; WriteToCC1000Register(CC1000_FREQ_1A,0xC0) ; WriteToCC1000Register(CC1000_FREQ_0A,0x00) ; //=====================配置寄存器B的值,用于發(fā)射433.565314 WriteToCC1000Register(CC1000_FREQ_2B,0x41) ; WriteToCC1000Register(CC1000_FREQ_1B,0xFB) ; WriteToCC1000Register(CC1000_FREQ_0B,0x2D) ; // sets frequency separation between 0 VALUE and 1 VALUE WriteToCC1000Register(CC1000_FSEP1, 0x02); WriteToCC1000Register(CC1000_FSEP0, 0x80); // sets some internal current levels, and enables RSSI OUTPUT to pin WriteToCC1000Register(CC1000_FRONT_END,0x12); //按datasheet好像應(yīng)該是0x02 // sets the PLL reference divider to divide by 14 WriteToCC1000Register(CC1000_PLL,0x70); // sets continuous LOCK indicator to OUTPUT on the CHP_OUT pin WriteToCC1000Register(CC1000_LOCK,0x10); // sets threshold level for peak detector (not used in this design) WriteToCC1000Register(CC1000_MODEM2, 0x8E); // sets the averaging FILTER to free-running and controlled by writes // to bit 4 of this register. // Sets averaging FILTER sensitivity to .6dB worst-case loss of sensitivity WriteToCC1000Register(CC1000_MODEM1, 0x69); // baud rate to 2.4, Transparent Syn. NRZ, and CRYSTAL freq. to 14 MHz WriteToCC1000Register(CC1000_MODEM0, 0x47); // sets CAPACITOR array VALUEs for RX and TX WriteToCC1000Register(CC1000_MATCH, 0x70); // disables dithering and data shaping WriteToCC1000Register(CC1000_FSCTRL, 0x01); // sets prescaling to nominal VALUEs WriteToCC1000Register(CC1000_PRESCALER,0); // sets CHARge pump current scaling factor, which determines the bandwidth // of the PLL. WriteToCC1000Register(CC1000_TEST4,0x25); //register set complete putsCHAR("register set complete"); // Calibration PROCESS // RX Calibration // set transceiver to RX mode TEMP=(ReadFromCC1000Register(CC1000_LOCK)&0x01); if(!TEMP) // printf("read initial LOCK valuue"); putsCHAR("read initial LOCK VALUE"); WriteToCC1000Register(CC1000_MAIN,0x11); WriteToCC1000Register(CC1000_CURRENT,0x44); // RX mode current WriteToCC1000Register(CC1000_CAL,0xA6); // begin calibration TEMP=ReadFromCC1000Register(CC1000_CAL); myprintf("%x",TEMP); callibrate_state= CalibrateCC1000(); if(callibrate_state) { // printf("RX callibrate success\n"); putsCHAR("RX callibrate success"); callibrate_state=0; } else { //printf("RX callibrate fail\n"); putsCHAR("RX callibrate fail"); } // TX Calibration WriteToCC1000Register(CC1000_MAIN,0xE1); // set to TX mode WriteToCC1000Register(CC1000_CURRENT,0x81); // TX mode current //WriteToCC1000Register(CC1000_PA_POW ,0x00); // set OUTPUT POWER to 0 during // calibration start callibrate_state= CalibrateCC1000(); if(callibrate_state) { //printf("TX callibrate success\n"); putsCHAR("TX callibrate success"); callibrate_state=0; } else { //printf("TX callibrate fail\n"); putsCHAR("TX callibrate fail"); } } 不知是什么原因,請(qǐng)用過(guò)該芯片的兄弟指點(diǎn),小弟不勝感激! |
| 2樓: | >>參與討論 |
| 作者: wolflet 于 2005/12/11 21:16:00 發(fā)布:
請(qǐng)教:無(wú)線芯片CC1000的校準(zhǔn)問(wèn)題 大家發(fā)表高見啊 |
|
| 3樓: | >>參與討論 |
| 作者: computer00 于 2005/12/11 21:48:00 發(fā)布:
先確認(rèn)寫寄存器、讀寄存器函數(shù)是否正確。 |
|
|
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |