4、相關(guān)學(xué)習(xí)-光盤編程指南_第1頁
4、相關(guān)學(xué)習(xí)-光盤編程指南_第2頁
4、相關(guān)學(xué)習(xí)-光盤編程指南_第3頁
4、相關(guān)學(xué)習(xí)-光盤編程指南_第4頁
4、相關(guān)學(xué)習(xí)-光盤編程指南_第5頁
已閱讀5頁,還剩21頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、RDA58202008.9.4RDA5820編程指南 v1.0The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in1part without prior written permisof RDA.RDA5820I2C 接口將MODE 引腳接低電平,即進(jìn)入I2C 接口模式。RDA5820 的I2C 接口與I2C-Bus Specification 2.1 兼容,包含 2 個(gè)信號(hào):S

2、CLK 和SDIO。I2C 接口是由START,命令字節(jié),數(shù)據(jù)字節(jié),及每個(gè)字節(jié)后的 ACK 或NACK 比特,和 STOP組成。命令字節(jié)包括一個(gè) 7 比特的 chip 地址(0010001b)和一個(gè)讀寫 r/w 命令比特。ACK(或NACK)由發(fā)出。RDA5820 的I2C 接口格式如下:圖 10 復(fù)合格式i2c 寫格式圖 11 復(fù)合格式i2c 讀格式From master to slaveA = acknowledge (SDA LOW)S = START conditionFrom slave to masterNA = not acknowledge (SDA HIGH)P = STOP

3、 condition圖 1I2C 接口寫數(shù)據(jù)時(shí)序The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in2part without prior written permisof RDA.RDA5820圖2I2C 接口讀數(shù)據(jù)時(shí)序I2C Timing Characteristics3 線接口將MODE 引腳接,即進(jìn)入 3 線接口模式。每次寄存器寫操作要 25 比特長(zhǎng)度,由高到低依次包括

4、4 比特的寄存器地址,1 比特The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in3part without prior written permisof RDA.ParameterSymbolTest ConditionMypMaxUnitSCLK Frequencyfscl0400KHzSCLK High Timethigh0.6usSCLK Low Timetlow1.3u

5、sSetup Time for START Conditiontsu:sta0.6usHold Time for START Conditionthd:sta0.6usSetup Time for STOP conditiontsu:sto0.6usSDIO Input to SCLK Setuptsu:dat100nsSDIO Input to SCLK Holdthd:dat0900nsSTOP to START Timetbuf1.3usSDIO Output Fall Timetf:out20+0.1Cb250nsSDIO Input, SCLK Rise/Fall Timetr:in

6、 tf:in20+0.1Cb300nsInpute Supprestsp50nsSCLK, SDIO Capacitive LoadingCb50RDA5820r/w ,4 比特的寄存器地位地址和 16 比特?cái)?shù)據(jù)(高比特先寫)。RDA5820 在SCLK 的上升沿對(duì)命令字節(jié)和數(shù)據(jù)字進(jìn)行采樣。每次寄存器讀操作也需要 25 比特長(zhǎng)度,由高到低依次包括 4 比特的寄存器地址,1比特r/w ,4 比特寄存器低位地址和 16 比特?cái)?shù)據(jù)(高比特先讀)。在 MCU 寫入命令字節(jié)和從 RDA5820 開始讀出數(shù)據(jù)之間有半個(gè) SCLK 的間隙。RDA5820 在 SCLK 的上升沿對(duì)命令字節(jié)進(jìn)行采樣,也在SCL

7、K 的上升沿向MCU 輸出數(shù)據(jù)。圖33 線接口寫數(shù)據(jù)時(shí)序圖43 線接口讀數(shù)據(jù)時(shí)序The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in4part without prior written permisof RDA.RDA5820Three-wire Timing Characteristics狀態(tài)轉(zhuǎn)換RDA5820 有 5 種狀態(tài):復(fù)位初始化(Reset&Initial),設(shè)置頻

8、點(diǎn)(Tune),搜臺(tái)(Seek),工作(Working),休眠(Sleep)。在上電和復(fù)位后,通過編寫ENABLE(02H,bit 0)寄存器,將其置為 1,即可使RDA5820 進(jìn)入上電狀態(tài)。通過編程相應(yīng)寄存器,即可使 RDA5820 進(jìn)入 Tune(包括TxTune 和 RxTune)或 Seek(包括 TxSeek 和 RxSeek)狀態(tài),這些操作之后,RDA5820進(jìn)入Working 狀態(tài)(包括Tx 和Rx)。通過將ENABLE 置為 0,可使RDA5820 進(jìn)入睡眠狀態(tài),此時(shí)所有寄存器值保持不變(與未睡眠之前相同)。在睡眠狀態(tài)時(shí),可通過編寫ENABLE 為 1,即可將RDA5820

9、回到正常工作(Working)狀態(tài)。The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in5part without prior written permisof RDA.ParameterSymbolTest ConditionMypMaxUnitSCLK Frequencyfclk010MHzSCLK High Timethigh25nsSCLK Low Timetlow25n

10、sSDIO Input, SEN to SCLK Setupts10nsSDIO Input, SEN to SCLK Holdth10nsSCLK to SDIO Output ValidtcdvRead210nsSEN to SDIO Output High ZtsdzRead210nsRDA5820圖 5 RDA5820 狀態(tài)轉(zhuǎn)移圖復(fù)位初始化(Reset&Initial)上電過,RDA5820 需要正確的Reset 和初始化過程來進(jìn)行上電。圖 6 Reset&Initial 時(shí)序圖編程偽程序:Supply VA and VD.Supply VIOProvide 32.768KHz cry

11、stal clock. (optional, if use TCXO)(or 12MHz/24MHz/13MHz/26MHz/19.2MHz/38.4MHz clk)Wait 1msMov 0 xD281, 02H/write enable=1The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in6part without prior written permisof RDA.RD

12、A5820Wait 0.5s/optional, for wait RCLK stable if use DCXO/通過 I2C 或 3 線接口進(jìn)行以下寫操作(初始化Mov 0 x?, ?HMov 0 x?, ?HMov 0 x?, ?HMov 0 x?, ?H寄存器,如必要,則由 RDA 提供)休眠(Sleep)在空閑時(shí),可以通過編程ENABLE(置 0)使 RDA5820 進(jìn)入睡眠模式,以便減小功耗。在睡眠模式,RDA5820 模擬和數(shù)字模塊電源都被關(guān)掉,但各寄存器值保持不變,SPI 和I2C接口依然可以工作。可以通過編程ENABLE(置 1)使RDA5820 進(jìn)入工作模式。進(jìn)入工作模式后

13、,需要重新設(shè)置所需要的頻點(diǎn),即重新進(jìn)行一次Tune 操作。編程偽程序:Enter Sleep Mode:Mov 0 xD280, 02HExit Sleep Mode:/clear ENABit low to bring RDA5820o sleep modeMov 0 xD281, 02hWait 0.5sMov 0 x0150, 03h/set ENABit high to bring RDA5820o working mode/optional, wait RCLK stable, if in DCXO mode/Set channel number to 87.5MHz, space

14、to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait for tune complete, if useerrupt*Wait for STC=1/optional, wait for tune complete, if use polling methodRead 0A, 0BHStop Tune/read stautsThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, o

15、r disclosed in whole or in7part without prior written permisof RDA.RDA5820接收(RX)設(shè)置 40H 寄存器的CHIP_FUNC3:0=0 即可定義當(dāng)前工作模式為 FM 接收模式。設(shè)置頻點(diǎn)(RxTune)可以通過配置 03H 寄存器來選擇 FM 頻道。搜臺(tái)(Seek)的步進(jìn)長(zhǎng)度(100KHz, 200KHz,50KHz)由 SPACE 來選擇,頻道由 CHAN9:0來選擇,頻率范圍(76MHz91MHz,87MHz108MHz, 76MHz108MHz 或用戶自定義 65MHz115MHz 范圍內(nèi)頻段)由BAND1:0來選

16、擇。自定義的頻段由寄存器 53H(chan_bottom)和 54H(chan_top)來設(shè)置,為 100KHz,即定義 65MHz76MHz,可設(shè)置 BAND1:0=3,并且設(shè)置chan_bottom=0 x028A,chan_top=0 x02f8。當(dāng)寫 03H 寄存器的TUNE 位為 1 時(shí),RDA5820 會(huì)自動(dòng)開始Tune。在 Tune 結(jié)束時(shí)(如果 STCIEN 設(shè)為 1,會(huì)產(chǎn)生一個(gè)中斷信號(hào)由 GPIO2 送出),STC 會(huì)被置 1,真假臺(tái)判斷結(jié)束后FM_READY 會(huì)被置 1,可以通過讀 0AH 和 0BH 寄存器來得到當(dāng)前頻點(diǎn)的狀態(tài)值(ST, FM_TRUE, FM_READY

17、, RSSI, READCHAN 等)。接收時(shí)整個(gè)Tune 過程要持續(xù)10ms,如需判斷真臺(tái)與否則需要 20ms。頻點(diǎn)計(jì)算方法見寄存器CHAN 和READCHAN 的換算公式。編程偽程序:Mov 0 x0000, 40HMov 0 x1A10, 03H/set Rx mode/Set channel number to 97.4MHz, space to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait for tune complete, if useerrupt*Wait for STC=1Read 0A, 0BH Stop Tune

18、/optional, wait for tune complete, if use polling method/read stautsThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in8part without prior written permisof RDA.RDA5820搜臺(tái)(RxSeek)1半自動(dòng)搜臺(tái)可以通過設(shè)定 02H 寄存器的 SEEK 和 SEEKUP 來設(shè)置

19、 RDA5820 進(jìn)行向上(向下)搜臺(tái)。同樣,SEEKTH6:0( seek 門限,對(duì)應(yīng)信噪比)也可通過寫 05H 寄存器來設(shè)定。RDA5820會(huì)跳到下一個(gè)(向上或下由 SEEKUP 確定)頻道來判斷其是否是真臺(tái),步進(jìn)由 SPACE 確定。在Seek 時(shí),如果 SKMODE 設(shè)為 0,在 Seek 時(shí),當(dāng) RDA5820觸到所選頻段的邊界時(shí),會(huì)自動(dòng)從另一邊界繞回,繼續(xù)搜臺(tái)。當(dāng) RDA5820 找到一個(gè)臺(tái)(RDA5820 會(huì)工作在當(dāng)前所在頻道上,STC 會(huì)被置 1,SF 會(huì)被置 0,F(xiàn)M_READY 和 FM_TRUE 都會(huì)被置 1),或者在整個(gè)頻道都沒有找到臺(tái),Seek 操作會(huì)停止(RDA58

20、20 會(huì)工作在Seek 操作前所在頻道上,STC 會(huì)被置 1,SF 會(huì)被置 1,F(xiàn)M_READY 會(huì)被置 1,而 FM_TRUE 則為 0);如果 SKMODE設(shè)為 1,在 Seek 時(shí),當(dāng) RDA5820觸到所選頻段的邊界時(shí)會(huì)停止Seek 并停留在邊界處(STC 會(huì)被置 1,SF 會(huì)被置 1,F(xiàn)M_READY 會(huì)被置 1,而 FM_TRUE 則為 0)。Seek 結(jié)束后,可以通過0AH 和 0BH 寄存器來得到當(dāng)前頻道號(hào),RSSI 值和其他一些狀態(tài)信息。RDA5820Seek 操作是由一連串的Tune 操作組成,每個(gè)頻點(diǎn)的 Tune 和搜臺(tái)判斷需要20ms,所以 Seek 操作的時(shí)間取決于被

21、搜頻點(diǎn)號(hào)的數(shù)量。在搜臺(tái)過,寫 02H 寄存器的SEEK 位為 0,則 RDA5820 會(huì)停止搜臺(tái),并停留在當(dāng)前搜索的頻點(diǎn)上,同時(shí) STC 會(huì)被置 1。RDA5820半自動(dòng)搜臺(tái)模式編程流程如下圖所示。(此模式兼容 5820/3/4 搜臺(tái),新的可根據(jù)需要采用搜臺(tái)或者全自動(dòng)搜臺(tái)模式)The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in9part without prior writte

22、n permisof RDA.RDA5820開始如:Tune到 5MHz,100KHz步進(jìn),87 8MHz范圍,則03H寄存器寫入0 x0150如:向上搜臺(tái) 02H寄存器寫0 xD381輪詢 STC或 FM_READY在用中斷方式時(shí),等價(jià)于等待中斷。中斷模式設(shè)置方法:將STCIEN設(shè)為1,將 GPIO21:0設(shè)為01.否STC=1?或 FM_READY=1?是否SF=1?或 FM_TRUE=0?是結(jié)束圖 7 RDA5820 硬件搜臺(tái)模式編程流程圖編程偽程序:Step1:Mov 0 x0000, 40HMov 0 x0150, 03H/set Rx mode/Set channel number

23、 to 87.5MHz, space to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait for tune complete, if useerrupt*Wait for STC=1/optional, wait for tune complete, if use polling methodThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in

24、 whole or in10part without prior written permisof RDA.RDA5820Read 0A, 0BH/read stautsGo to step2Step2:Mov 0 xD381, 02H/ set SEEK and SEEKUor seek operation*Wait fPIO2=0/optional, wait for seek complete, if useerrupt*Wait for STC=1 or FM_READY=1/optional, wait for seek complete, if use polling method

25、Read 0A, 0BH/read stautsIf SF=1 or FM_TRUE=0, go to step3;else memorize READCHAN and go to step2.Step3:Stop Seek2手動(dòng)搜臺(tái)RDA5820搜臺(tái)模式編程流程如下圖所示。(這種搜臺(tái)方式,控制起來比較靈活,并且適用于帶搜臺(tái)頻點(diǎn)顯示功能的)The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole

26、 or in11part without prior written permisof RDA.RDA5820圖 8 RDA5820搜臺(tái)模式編程流程圖編程偽程序:Step1:Mov 0 x0000, 40HCHAN=0 x0005;/set Rx modeVALUE=(CHAN6)+0 x0010;Mov VALUE, 03HGo to step2 Step2:/Set channel number to 87.5MHz, space to 100KHz, band to 87108MHzWait for FM_READY=1The information contained herein i

27、s the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in12part without prior written permisof RDA.RDA5820Read 0A, 0BH/read stautsIf freqStep3:band limit, go to Step4. Else go to Step3.If FM_TRUE=1, memorize READCHAN.CHAN=CHAN+1;VALUE=(CHAN6)+0 x0010; Mov

28、VALUE, 03HGo to Step2.Step4:Stop Seek.3全自動(dòng)搜臺(tái)RDA5820 提供了全自動(dòng)搜臺(tái)模式,即只需設(shè)置搜臺(tái)頻段(BAND0:1),搜臺(tái)步進(jìn)(SPACE1:0),搜臺(tái)方向(SEEKUP),搜臺(tái)起始頻點(diǎn)(CHANNEL9:0),搜臺(tái)停止模式(SKMODE,到邊停止或到邊繞回),并且設(shè)置 40H 寄存器的AUTO_SEEK=1,同時(shí)觸發(fā) 02H 的 SEEK,就會(huì)在頻段內(nèi)搜臺(tái),并把搜到的所有臺(tái)號(hào),存在 RDA5820 的FIFO(讀 FIFO 的地址為 FEH)里面。搜臺(tái)結(jié)束后,STC 會(huì)被置 1,所搜到的臺(tái)的數(shù)目會(huì)寫在 4BH 寄存器的CHAN_NUM7:0里。此

29、時(shí)可以通過i2c 或 3 線接口,從 FIFO里把相應(yīng)的電臺(tái)號(hào)取出 (為保證 FIFO 里面的指針不影響搜臺(tái)結(jié)果,全自動(dòng)搜臺(tái)前應(yīng)先將FIFO 里的指針復(fù)位,方法即先寫 41H 的MEM_CLR=1,再寫MEM_CLR=0)。在搜臺(tái)過,寫 02H 寄存器的 SEEK 位為 0,則 RDA5820 會(huì)停止搜臺(tái),并停留在當(dāng)前搜索的頻點(diǎn)上,同時(shí)STC 會(huì)被置 1。RDA5820 全自動(dòng)搜臺(tái)模式編程流程如下圖所示。(這種方法優(yōu)點(diǎn)是搜臺(tái)快速,減少了主控和RDA5820 的交互)The information contained herein is the exclusive property of RDA

30、 and shall not be distributed, reproduced, or disclosed in whole or in13part without prior written permisof RDA.RDA5820開始如:Tune到 5MHz,100KHz步進(jìn),87 8MHz范圍,則03H寄存器寫入0 x0150如:向上搜臺(tái), 02H寄存器寫0 xD381輪詢 STC或 FM_READY在用中斷方式時(shí),等價(jià)于等待中斷。中斷模式設(shè)置方法:將STCIEN設(shè)為1,將 GPIO21:0設(shè)為01.否STC=1?或 FM_READY=1?是結(jié)束編程偽程序:Step1:Mov 0 x

31、0000, 40HMov 0 x0150, 03H/set Rx mode/Set channel number to 87.5MHz, space to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait for tune complete, if useerruptThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in14p

32、art without prior written permisof RDA.寫寫40H寄存器 AUTO_SEEK=0讀 4BH寄存器的 CHAN_NUM讀CHAN_NUM次FEH寄存器,并把每次讀出的值按照公式換算成頻率記錄在中等待 500ms1.寫40H寄存器 AUTO_SEEK=1 2.復(fù)位FIFO3.寫02H寄存器觸發(fā)Seek將入寫03H寄存器 Tune到起始頻點(diǎn)87.10應(yīng)將RDA5820*Wait for STC=1/optional, wait for tune complete, if use polling methodRead 0A, 0BHGo to step2 Step

33、2:/read stautsMov 0 x8000, 40HMov 0 x1300, 41HMov 0 x0300, 41H Mov 0 xD381, 02H/set Rx mode & AUTO SEEK MODE=1/reset FIFO address po/reset FIFO address po/ set SEEK and SEEKUereror seek operation*Wait fPIO2=0/optional, wait for seek complete, if useerrupt*Wait for STC=1 or FM_READY=1/optional, wait

34、for seek complete, if use polling method Read 4BH CHAN_NUM/read CHAN_NUMFor (i=1,i=CHAN_NUM,i=i+1)Read FEH, and memorize the value jusgo to step3.Step3:s been readMov 0 x0000, 40H/set Rx mode & AUTO SEEK MODE=0Stop Seek小天線模式(Antenna)RDA5820 支持小天線,在接收狀態(tài)時(shí)設(shè)置 02H 寄存器的 ANTENNA=1,然后進(jìn)行Tune 或Seek(在使用小天線進(jìn)行搜臺(tái)

35、時(shí),搜臺(tái)速度較慢)操作即可。不采用小天線,則設(shè)置ANTENNA=0 即可。2FIFO模式RDA5820有 個(gè) FIFO , 供RDS 等 信 息 用 。 設(shè) 置 64H 寄 存 器 的 RDS_RXMOD1:0=2,即為 FIFO模式。當(dāng)接收RBDS/RDS 同步后,RBDS/RDS 的信息會(huì)以GROUP 為依次寫入FIFO 中。The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or i

36、n15part without prior written permisof RDA.RDA5820寫入FIFO 中的RBDS/RDS 信息依次為:第n-1 組:,BLOCK C(或c/E),BLOCKD(或E),BLOCK INFO(包括各 block 的誤碼信息,和 block E 的指示信息),第 n 組:BLOCK A(或E),BLOCK B(或E),BLOCK C(或c/E),BLOCK D(或E),BLOCKINFO(包括各 block 的誤碼信息,和 block E 的指示信息),第 n+1 組:BLOCK A(或 E),BLOCK B(或E),。由于RBDS/RDS 存入FIF

37、O 是以 5 個(gè) 16bit 為,所以此時(shí)設(shè)置FIFO 的長(zhǎng)度(41H 寄存器MEM_DEPTH8:0)必須為 5 的倍數(shù)。當(dāng) FIFO 中的數(shù)據(jù)達(dá)到中斷要求時(shí), 同樣可以送出中斷信號(hào),設(shè)置相應(yīng)的MEM_MOD4:0( 4AH 寄存器),并且 GPIO21:0為 01 即可在GPIO2 引腳送出FIFO的中斷信號(hào)。設(shè)置 FIFO 長(zhǎng)度為 5*n ( MEM_DEPTH8:0=5n ), FIFO 中斷源為 FULL 模式 (MEM_MOD4:0=16)時(shí),當(dāng)接收到的 RBDS/RDS 信息為n 個(gè)GROUP 時(shí),會(huì)產(chǎn)生中斷,需要通過讀 5*n 次FEH 寄存器從 FIFO 里數(shù)據(jù)(從中斷產(chǎn)生到

38、結(jié)束,要控制在 80ms 以內(nèi))。編程偽程序:Step1:Mov 0 x0000, 40HMov 0 x0010, 64H/set Rx mode/set RDS_RXMOD1:0=2Mov 0 x8300, 41HMov 0 x02FF, 41H Mov 0 x0010, 4AH Mov 0 x0640, 04H/reset FIFO address poer/set MEM_DEPTH8:0 = 255/set BUF_MOD4:0 = 16/set GPIO21:0=1Mov 0 xD289, 02HMov 0 x0150, 03h/set RBDS/RDS enable./Set ch

39、annel number to 87.5MHz, space to 100KHz, band to 87108MHzThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in16part without prior written permisof RDA.RDA5820Step2:Wait fPIO2=0/optional, wait for FIFO fullerrupt, if

40、useerrupt modeRead 0A0CH/read RDS information, and clearerrupts been readFor (i=0;i255;i=i+1) read FEH, store RDS information jusSoftware decode RDS informationIf end RDS receive, go to Step3; else go to Step 2.Step3:Mov 0 xD281, 02H/clear RBDS/RDS enable.Stop RDS receive發(fā)射(TX)設(shè)置 40H 寄存器的CHIP_FUNC3:

41、0=1 即可定義當(dāng)前工作模式為 FM 接收模式。設(shè)置頻點(diǎn)(TxTune)可以通過配置 03H 寄存器來選擇 FM 頻道。搜臺(tái)(Seek)的步進(jìn)長(zhǎng)度(100KHz, 200KHz,50KHz)由 SPACE 來選擇,頻道由 CHAN9:0來選擇,頻率范圍(76MHz91MHz,87MHz108MHz, 76MHz108MHz 或用戶自定義 65MHz115MHz 范圍內(nèi)頻段)由BAND1:0來選擇。自定義的頻段由寄存器 53H(chan_bottom)和 54H(chan_top)來設(shè)置,為 100KHz,即定義 65MHz76MHz,可設(shè)置 BAND1:0=3,并且設(shè)置chan_bottom=

42、0 x028A,chan_top=0 x02f8。當(dāng)寫 03H 寄存器的TUNE 位為 1 時(shí),RDA5820 會(huì)自動(dòng)開始Tune。在 Tune 結(jié)束時(shí)(如果 STCIEN 設(shè)為 1,會(huì)產(chǎn)生一個(gè)中斷信號(hào)由 GPIO2 送出),STC 會(huì)被置 1,真假臺(tái)判斷結(jié)束后FM_READY 會(huì)被置 1,可以通過讀 0AH 和 0BH 寄存器來得到當(dāng)前頻點(diǎn)的狀The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in wh

43、ole or in17part without prior written permisof RDA.RDA5820態(tài)值(ST, FM_TRUE, FM_READY, RSSI, READCHAN 等)。發(fā)射時(shí)整個(gè)Tune 過程要持續(xù)100ms。頻點(diǎn)計(jì)算方法見寄存器CHAN 和READCHAN 的換算公式。編程偽程序:Mov 0 x0001, 40HMov 0 x1A10, 03H/set Tx mode/Set channel number to 97.4MHz, space to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait fo

44、r tune complete, if useerrupt*Wait for STC=1/optional, wait for tune complete, if use polling methodRead 0A, 0BHStop Tune/read sus掃描空閑臺(tái)(TxSeek)RDA5820 提供掃描空中空閑頻點(diǎn)的功能,以便在 FM 發(fā)射時(shí)選擇干擾較小的頻點(diǎn)進(jìn)行發(fā)射,從而提高發(fā)射性能。設(shè)置 RDA5820 為接收模式,將 40H 寄存器的 CHAN_SCAN 設(shè)為 1,利用RxSeek 中的全自動(dòng)搜臺(tái)方法,進(jìn)行空中頻點(diǎn)掃描。搜索到的頻點(diǎn)即為空中干擾小的頻點(diǎn)。將 RDA5820 設(shè)回發(fā)射

45、模式,選擇 1 個(gè)搜索到的頻率,進(jìn)行 TxTune 操作,即可進(jìn)行 FM 發(fā)射。編程偽程序:Step1:Mov 0 x4000, 40HMov 0 x0150, 03H/set Rx mode & CHAN_SCAN=1 & AUTO_SEEK=1/Set channel number to 87.5MHz, space to 100KHz, band to 87108MHz*Wait fPIO2=0/optional, wait for tune complete, if useerrupt*Wait for STC=1Read 0A, 0BH Go to step2Step2:/optio

46、nal, wait for tune complete, if use polling method/read stautsThe information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in18part without prior written permisof RDA.RDA5820Mov 0 x1300, 41H/reset FIFO address poerMov 0 x0300, 4

47、1HMov 0 xD381, 02H/reset FIFO address po/ set SEEK and SEEKUeror seek operation*Wait fPIO2=0/optional, wait for seek complete, if useerrupt*Wait for STC=1 or FM_READY=1/optional, wait for seek complete, if use polling methodRead 4BH CHAN_NUM/read CHAN_NUMFor (i=1,i=CHAN_NUM,i=i+1)Read FEH, and memor

48、ize the value juss been readgo to step3.Step3:Mov 0 x0001, 40H Mov 0 x?, 03H/set Tx mode & AUTO SEEK MODE=0 & CHAN_SCAN=0/Set channel number, space, band (frequency scanned)*Wait fPIO2=0/optional, wait for tune complete, if useerrupt*Wait for STC=1Read 0A, 0BH Stop Tune/optional, wait for tune compl

49、ete, if use polling method/read sus其他功能PARDA5820 可作音頻放大器用,設(shè)置CHIP_FUNC3:0=8,并且 ENABLE=1 即可。DACRDA5820 可作dac 使用,用i2s 通過gpio 口將音頻數(shù)據(jù)寫入RDA5820,而 RDA5820 則將接收到的音頻數(shù)據(jù)通過其的 dac出來。設(shè)置 CHIP_FUNC3:0=12,并且ENABLE=1 即可。I2SRDA5820 的發(fā)射和接收都可以使用 i2s。支持多種采樣率。在發(fā)射或接收模式時(shí),設(shè)置The information contained herein is the exclusive p

50、roperty of RDA and shall not be distributed, reproduced, or disclosed in whole or in19part without prior written permisof RDA.RDA5820I2S_EN=1 即可。FIFORDA5820的 FIFO 可以提供給主控使用,以擴(kuò)展主控的空間。FIFO 最大可達(dá)到256x16bit,即最大長(zhǎng)度為 256,并且可通過寄存器 MEM_DEPTH8:0進(jìn)行設(shè)置。FIFO 可通過i2c 或 3 線接口,寫的地址為FDH,讀的地址為FEH,讀寫時(shí)序格式與i2c 和 3 線接口一致。寄存

51、器說明The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in20part without prior written permisof RDA.REGBITSNAMEFUNCTIONDEFAULT00H15:0CHI7:0Chi.0 x582002H15DHIZAudio Output High-Z Disable.0 = High impedance; 1 = Normalope

52、ration014DMUTEMute Disable.0 = Mute; 1 = Normal operation013MONOMono Select.0 = Stereo; 1 = Force mono012BASSBass Boost.0 = Disabled; 1 = Bass boostenabled011RESEVEDMust be 0010?9SEEKUPSeek Up.0 = Seek down; 1 = Seek up08SEEKSeek.0 = Disable&Stop seek; 1 = EnableSeek beginshe direction specified by

53、SEEKUP and ends when a channel is found or the entire band has been searched.The SEEK bit is set low and the STCbit is set high when the seekoperation completes.07SKMODESeek Mode0RDA5820The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or dis

54、closed in whole or in21part without prior written permisof RDA.REGBITSNAMEFUNCTIONDEFAULT0 = wrap at the upper or lower band limit and continue seeking1 = stop seeking at the upper or lower band limit6:4CLK_MODE2:0000=32.768kHz001=12Mhz101=24Mhz010=13Mhz110=26Mhz011=19.2Mhz111=38.4Mhz0002ANTENNA1 =

55、inner antenna 0 = normal01SOFT_RESETSoft reset.If 0, not reset; If 1, reset.00ENABLEer Up Enable.0 = Disabled; 1 = Enabled003H15:6CHAN7:0Channel Select. BAND = 0Frequency =Channel Spacing (kHz) x CHAN+ 87MHzBAND = 1 or 2Frequency =Channel Spacing (kHz) x CHAN +76.0 MHzCHAN is updated after a seek op

56、eration.BAND = 3Frequency =Channel Spacing (kHz) x CHAN +CHAN_BOTTOM x 100KHzCHAN is updated after a seek operation.0 x005Must be 004TUNETune0 = Disable1 = EnableThe tune operation begins when the TUNE bit is set high. The STC bit is set high when the tune operation completes.The tune bit is reset t

57、o low0RDA5820The information contained herein is the exclusive property of RDA and shall not be distributed, reproduced, or disclosed in whole or in22part without prior written permisof RDA.REGBITSNAMEFUNCTIONDEFAULTautomaticallywhenthetune operation completes.3:2BAND1:0Band Select.00 = 87108 MHz (U

58、S/Europe)01 = 7691 MHz (Japan)10 = 76108 MHz (Japan wide) 11 = user defined via 53H54H001:0SPACE1:0Channel Spacing. 00 = 100 kHz01 = 200 kHz10 = 50kHz11 =0014STCIENSeek/TuneCompleteerrupt Enable.0 = Disableerrupt 1 = EnableerruptSetting STCIEN = 1 will generate alow pulse on GPIO2 when the errupt oc

59、curs.012Must be 0011DEDe-emphasis.0 = 75 s; 1 = 50 s09:7Must be 0000006I2S_ENABLEDI2S bus enable If 0, disabled;If 1, enabled.05:4GPIO31:0General Pure I/O 3.00 = High impedance01 = Mono/Stereo indicator (ST) 10 = Low11 = High003:2GPIO21:0General Pure I/O 2.00 = High impedance01 =errupt () 10 = Low11

60、 = High001:0GPIO11:0General Pure I/O 1.00 = High impedance01 =10 = Low11 = High0005H15_MODEIf 0, generate 5mserrupt;If 1,errupt last until read reg0CH action occurs.114:8SEEKTH6:0SeekThreshold.RSSIscaleis logarithmic.0001000RDA5820The information contained herein is the exclusive property of RDA and

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論