久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2618|回復: 1
打印 上一主題 下一主題
收起左側

430下的SI4432模塊初始化

[復制鏈接]
跳轉到指定樓層
樓主
ID:88321 發表于 2015-9-1 10:40 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式

// ----------------------------------------------------------------------
// 無線模塊初始化
// ----------------------------------------------------------------------
void RF_init(void)
{
    SpiWriteRegister(0x07, 0x80);//SW reset  //向0X07地址  寫入0X80  軟件復位
    while ( RF4432_IRQ == 1); //讀取中斷狀態          清除中斷  釋放         SI4432_NIRQ
    ItStatus1 = SpiReadRegister(0x03);        //讀取中斷狀態          清除中斷  釋放         SI4432_NIRQ                                                                                                //read the Interrupt Status1 register
    ItStatus2 = SpiReadRegister(0x04);                                                                                                        //read the Interrupt Status2 register


    SpiWriteRegister(0x06, 0x80);       
    SpiWriteRegister(0x07, 0x01);                                                                                                                        //write 0x80 to the Operating & Function Control1 register
    SpiWriteRegister(0x09, 0x64);                //云寶
    //SpiWriteRegister(0x09, 0x7f);     //思為

    SpiWriteRegister(0x0A, 0x05);  //關閉低頻輸出
    SpiWriteRegister(0x0B, 0xEA);  //GPIO 0 當做普通輸出口
    SpiWriteRegister(0x0C, 0xEA);  //GPIO 1 當做普通輸出口
    SpiWriteRegister(0x0D, 0xF4);  //GPIO 2 輸出收到的數據

    SpiWriteRegister(0x70, 0x24);  //0x2c);  // 下面的設置根據Silabs 的Excel
    SpiWriteRegister(0x1D, 0x40);  // 使能 afc
       
    ///*/ 1.2K bps setting
    SpiWriteRegister(0x1C, 0x16);       
    SpiWriteRegister(0x20, 0x83);

        SpiWriteRegister(0x21, 0xc0);  //
        SpiWriteRegister(0x22, 0x13);  //
        SpiWriteRegister(0x23, 0xa9);  //
        SpiWriteRegister(0x24, 0x00);  //
        SpiWriteRegister(0x25, 0x04);  //
       
        SpiWriteRegister(0x2A, 0x14);// 1.2K bps 發射速率
        SpiWriteRegister(0x6E, 0x09);
        SpiWriteRegister(0x6F, 0xd5);
        //SI4432_WriteReg(0x70, 0x2c);//


        SpiWriteRegister(0x6D, 0x07);  //07 設置為最大功率發射
        SpiWriteRegister(0x0D, 0xFC);  //GPIO 2 信道空閑指示(常態為低,忙為高)
        SpiWriteRegister(0x79, 0x00);   // 不需要跳頻
        SpiWriteRegister(0x7A, 0x00);   // 不需要跳頻

        SpiWriteRegister(0x71, 0x22);  // 發射不需要 CLK,FiFo , FSK模式                       
        SpiWriteRegister(0x72, 0x30);  // 頻偏為 30KHz
       
        SpiWriteRegister(0x73, 0x00);   // 沒有頻率偏差
        SpiWriteRegister(0x74, 0x00);   // 沒有頻率偏差
       
        //SpiWriteRegister(0x75, 0x53);  // 頻率設置 433.5
        //SpiWriteRegister(0x76, 0x57);  //
        //SpiWriteRegister(0x77, 0x80);
        SpiWriteRegister(0x75, 0x60);  // 頻率設置 490
        SpiWriteRegister(0x76, 0x7d);  //
        SpiWriteRegister(0x77, 0x00);                                                                                               
                                                               
        /*set the packet structure and the modulation type*/
        //set the preamble length to 10bytes
        SpiWriteRegister(0x34, 0x0C);                                                                                                                        //write 0x0A to the Preamble Length register
        //set preamble detection threshold to 20bits
        SpiWriteRegister(0x35, 0x2A);                                                                                                                 //write 0x2A to the Preamble Detection Control  register

        //Disable header bytes; set variable packet length (the length of the payload is defined by the
        //received packet length field of the packet); set the synch word to two bytes long
        SpiWriteRegister(0x33, 0x02);                                                                                                                        //write 0x02 to the Header Control2 register   
       
        //Set the sync word pattern to 0x2DD4
        SpiWriteRegister(0x36, 0x2D);                                                                                                                        //write 0x2D to the Sync Word 3 register
        SpiWriteRegister(0x37, 0xD4);                                                                                                                        //write 0xD4 to the Sync Word 2 register

        //enable the TX & RX packet handler and CRC-16 (IBM) check
        SpiWriteRegister(0x30, 0x8D);                                                                                                                        //write 0x8D to the Data Access Control register
        //Disable the receive header filters
        SpiWriteRegister(0x32, 0x00);
       
        /*enable receiver chain*/
        SpiWriteRegister(0x07, 0x05);        //打開接收                                                                                                                 //write 0x05 to the Operating Function Control 1 register
        //Enable two interrupts:
        // a) one which shows that a valid packet received: 'ipkval'
        // b) second shows if the packet received with incorrect CRC: 'icrcerror'
        SpiWriteRegister(0x05, 0x03);         //打開 接收中斷                                                                                                        //write 0x03 to the Interrupt Enable 1 register
        SpiWriteRegister(0x06, 0x00);                                                                                                                 //write 0x00 to the Interrupt Enable 2 register
        //read interrupt status registers to release all pending interrupts
        ItStatus1 = SpiReadRegister(0x03);                                                                                                          //read the Interrupt Status1 register
        ItStatus2 = SpiReadRegister(0x04);
}


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:136504 發表于 2016-9-7 16:09 | 只看該作者
HW3000國產第一家433無線模塊,完美替換si4432,4463.cc1101。一不小心就省了一輛寶馬的錢。咨詢電話:13570852936;
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 91午夜在线| 国产精品久久久久久吹潮 | 亚洲欧美日韩精品久久亚洲区 | 成人在线黄色 | 精品99久久久久久 | 91精品一区二区三区久久久久 | 中文字幕亚洲专区 | 九九色综合 | 中文在线观看视频 | 精品久久久久一区二区国产 | 欧美激情国产日韩精品一区18 | 日韩免费一级 | 国产视频1| 日韩电影在线一区 | 午夜欧美 | 久久国产亚洲精品 | 欧美色综合| 免费国产一区二区 | 欧洲亚洲一区 | 久久视频精品 | 99re视频在线 | 亚洲免费一区 | 中文字字幕在线中文乱码范文 | 精品一区二区在线观看 | 国产成人精品亚洲日本在线观看 | 亚洲国产精品久久久久秋霞不卡 | 日日干夜夜干 | 免费成人在线网站 | 午夜精品一区 | 国产精品久久久久久久久久 | 91视频大全 | 欧美成人a∨高清免费观看 欧美日韩中 | 婷婷成人在线 | 久久综合一区 | 国产一区精品 | 国产午夜精品一区二区三区嫩草 | 狠狠干网站 | 精精国产视频 | 国产成人jvid在线播放 | 精品一区二区在线观看 | 九一精品 |