您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > RDA5820系列编程指南
RDA5820系列2011.7.23TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.1RDA5820系列编程指南V3.0RDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.2一、说明RDA5820系列包括RDA5820、RDA5820NS,下文简称为RDA5820。RDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.3二控制接口RDA5820提供两种控制接口,I2C和SPI3线,控制接口的选择通过PIN7:MODE上设置高低电平来选择。MODE:0I2C;MODE:1SPI。两种接口的控制模式如下描述:(一)、I2C控制接口:I2C接口与I2C-BusSpecification2.1兼容,包含2个信号:SCLK和SDIO。I2C接口是由START,命令字节,数据字节,及每个字节后的ACK或NACK比特,和STOP组成,命令字节包括一个7比特的chip地址(0010001b)和一个读写r/w命令比特。ACK(或NACK)由接收器发出。读写方式和器件地址详细描述如下:1、RDA5820的读写方式标准I2C读写方式一致,即带寄存器地址的方式,I2C器件地址为0010001B,加上读写标志位,即为0x22(写操作)和0x23(读操作),读写方式的格式如下:STARTI2CCHIPADDRESSWAREGISTERADDRESSAREGISTERBIT15:8ASTOPREGISTERBIT7:0A/NA图1RDA5820I2C写格式STARTI2CCHIPADDRESSWAREGISTERADDRESSA/NAREGISTERBIT15:8ASTOPREGISTERBIT7:0NASTARTI2CCHIPADDRESSRA图2RDA5820I2C读格式FrommastertoslaveFromslavetomasterA=acknowledge(SDALOW)NA=notacknowledge(SDAHIGH)S=STARTconditionP=STOPconditionRDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.4SCLKSDIO1-7891-7891-789STARTACKREGISTERADDRESSACKWCHIPaddressDATAhighbyteACKSTOPtsu:stathd:statspSTARTtsu:stotbuftsu:datthd:dat00100019ACK1-7DATAlowbyte8图3I2C接口写数据时序SCLKSDIO1-7891-7891-789STARTACKDatahighbyteACKWCHIPaddressDatalowbyteNACKSTOPtspSTARTtbuftsu:stathd:statsu:datthd:dattsu:sto00100011-789ACKREGISTERADDRESStspRESTART1-78RCHIPaddressACK图4I2C接口读数据时序I2CTimingCharacteristicsParameterSymbolTestConditionMinTypMaxUnitSCLKFrequencyfscl0-400KHzSCLKHighTimethigh0.6--usSCLKLowTimetlow1.3--usSetupTimeforSTARTConditiontsu:sta0.6--usHoldTimeforSTARTConditionthd:sta0.6--usSetupTimeforSTOPconditiontsu:sto0.6--usSDIOInputtoSCLK↑Setuptsu:dat100--nsSDIOInputtoSCLK↓Holdthd:dat0-900nsSTOPtoSTARTTimetbuf1.3--usSDIOOutputFallTimetf:out20+0.1Cb-250nsSDIOInput,SCLKRise/FallTimetr:intf:in20+0.1Cb-300nsInputSpikeSuppressiontsp--50nsSCLK,SDIOCapacitiveLoadingCb--50pFRDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.52、RDA5820还有另外一组未使用的I2C器件地址0010000B,加上读写标志,即为0x20和0x21,即RDA5820总共有两组I2C器件地址,分别是0x20和0x21,0x22和0x23,在硬件设计时,如果RDA5820与其他I2C器件共用I2C总线时,请注意避免I2C器件地址冲突的问题。(二)、SPI控制接口将MODE引脚接高电平,即进入3线接口模式。每次寄存器写操作要25比特长度,由高到低依次包括4比特的寄存器高位地址,1比特r/w,4比特的寄存器地位地址和16比特数据(高比特先写)。RDA5807PMode在SCLK的上升沿对命令字节和数据字进行采样。每次寄存器读操作也需要25比特长度,由高到低依次包括4比特的寄存器高位地址,1比特r/w,4比特寄存器低位地址和16比特数据(高比特先读)。在MCU写入命令字节和从RDA5807PMode开始读出数据之间有半个SCLK的间隙。RDA5807PMode在SCLK的上升沿对命令字节进行采样,也在SCLK的上升沿向MCU输出数据。图53线接口写数据时序RDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.6图63线接口读数据时序Three-wireTimingCharacteristicsParameterSymbolTestConditionMinTypMaxUnitSCLKFrequencyfclk0-10MHzSCLKHighTimethigh25--nsSCLKLowTimetlow25--nsSDIOInput,SENtoSCLK↑Setupts10--nsSDIOInput,SENtoSCLK↑Holdth10--nsSCLK↑toSDIOOutputValidtcdvRead2-10nsSEN↑toSDIOOutputHighZtsdzRead2-10nsRDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.7二、状态转换RDA5820有5种状态:复位初始化(Reset&Initial),设置频点(Tune),搜台(Seek),工作(Working),休眠(Sleep)。在芯片上电和复位后,软件通过编写ENABLE(02H,bit0)寄存器,将其置为1,即可使RDA5820进入上电状态。软件通过编程相应寄存器,即可使RDA5820进入Tune(包括TxTune和RxTune)或Seek(包括TxSeek和RxSeek)状态,这些操作之后,RDA5820进入Working状态(包括Tx和Rx)。软件通过将ENABLE置为0,可使RDA5820进入睡眠状态,此时所有寄存器值保持不变(与未睡眠之前相同)。在睡眠状态时,软件可通过编写ENABLE为1,即可将RDA5820回到正常工作(Working)状态。SleepWorkingReset&InitialTuneSeekPoweron图7RDA5820状态转移图RDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.8三、复位初始化(Reset&Initial)RDAFM系列芯片的初始操作顺序:复位→读取芯片ID→上电→根据芯片版本写相应初始化数据。(一)、复位及上电操作1、复位操作通过写0x0002到02H来实现;2、当使用RDA5820带晶振模块,或者单独给RDA5820供32.768KHz晶振时,需要执行上电操作,这一操作通过写0xC001到02H来实现,上电后需要延时600mS以上,以保证晶体振动稳定。编程伪程序:SupplyVAandVD.SupplyVIOProvide32.768KHzcrystalclock.Wait1msMov0x0002,02H//writeenable=1Wait50msMov0xC001,02HWait600ms//optional,forwaitRCLKstableifuseDCXORDA5820TheinformationcontainedhereinistheexclusivepropertyofRDAandshallnotbedistributed,reproduced,ordisclosedinwholeorinpartwithoutpriorwrittenpermissionofRDA.9(二)、芯片ID读取当进行复位操作后,可通过读取00H获的RDA5820芯片ID,其中RDA5820的芯片ID为0x5805,RDA5820NS的芯片ID为0x5820。(三)、初始化操作初始化操作通过I2C或3线SPI接口把初始化参数写到芯片内部来实现,而编程及调试时,需要注意的是02H的初始值:1、由于RDA5820只支持32.768KHz的晶振或者时钟,因此,RDA5820的02H的初始值为0xC001;2、RDA5820NS支持多种时钟模式(详细请看datasheet中02寄存器),与其他器件共用晶振时,需要按照晶振的频率来设置02H的初始值,具体为设置02H的CLK_MODE(Bit[6:4]),同时需要把02H的Bit10置1。例:当共用12MHz晶振时,02H的初始值为0xC411;当共用24MHz晶振时,02H的初始值为0xC451;3、请联系我代理商FAE获取最新初始化参数列表。RDA
本文标题:RDA5820系列编程指南
链接地址:https://www.777doc.com/doc-4652120 .html