6-DSP第六章-C54x片内外设、接口及应用(精)_第1页
6-DSP第六章-C54x片内外设、接口及应用(精)_第2页
免费预览已结束,剩余25页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 内容提要 主机接口 HPI 串行接口 6.1 主机接口 HPI 8/16位并行口,用来实现与主设备或主处理器的 通信。 Figure 8-6. Host Port Interface Block Diagram H0(7-0) interface control signals L ! i;! :! Address Ester HPI conlrd togie M?X/ 16 Data Addrvw HPI memory block HPI control reg stef DSP acdress. 6.1 主机接口 HPI 主机使用HPI寄存器执行数据传输,HPI控制逻 辑自动执行对C54

2、x内部的双寻址RAM的访问 地址和数据寄存器 HPI控制寄存器 Table 8-20. HPI Registers Description Name Address Description HPIA HPI address register Directly accessfcle only by the host. Contains the address in the HPI memory at 刖 ch the current access occurs HPIC 002Ch HPI control register. Directly accessioie fcyeiiherihe ho

3、st or by the C54x DSP. Con tains cortrol and sta:us txts for HPI operatons. HPID HPI dnta register Oirectty occegble ony by the host Contamg the asm 6.2 定时器 TIMER 脉冲频率检测(高频信号) 检测输入脉冲频率是通过外部中断请求输入來实现。 定时器的定时时间是根据所检测输入信号的周期來设 定。 根据设定时间内所检测脉冲的个数,计算被检测输入 信号的频率。 第一个负跳变触发定时器工作,每输入一个负跳变计 一个数。当达到设定时间时,定时器停止

4、工作。则此 时定时器的时间值与所计脉冲数相除,所得的结果就 是所测输入信号的周期。 思考:主程序、INTO_ISR、Timer_ISR6.2定 6.3 串行口 Serial Ports on the TMS320C54X Devices Device Standard MultiChannel Buffered Serial Ports Time-Division Multiplexed Serial Ports Synchronous Serial Ports Buffered Serial Ports C541 2 0 0 0 CM2 U 1 u 1 C543 0 1 0 1 C545 1

5、 1 0 0 C546 1 1 0 0 C548 0 2 0 1 C549 0 2 0 1 C5402 0 0 2 0 C5410 0 0 3 0 C5420 0 0 6 0 6.3 串行口 标准同步串行口 SP 组成 数据接收寄存器DRR; 数据发送寄存器DXR; 接收移位寄存器RSR; 发送移位寄存器XSR; 二个装载控制逻辑电路; 二个位/字控制计数器。 R/w R 6.3 串行口 SP结构 6.3 串行口 控制寄存器 SPC仿真 控制 仿真 控制 接收移位 寄存器 满 发送移位 寄存器 空 发送 准备 好 接收 准备 好 7 6 5 4 3 2 收钟态 接时状 送钟态 发时状 SPCH

6、 Fre e H MMMW RSRFULL XSREMPIY XRDY RRDY INI INO RR time 6.3 串行口 TDM 串口操作通过 6个 MMR 和 2 个其他专用寄 存器来实现。 TRCV数据接收寄存器 TDM Serial Port Registers Address Register Description TRCV TDM data receive register t TDXR TDM data transmit register t TSPC TDM serial port control register t TCSR TDM channel select r

7、egister TRTA TDM recer/e/tnnsmrt nddress register t TRAD TDM receive address register TRSR TDM data receive shift register TXSR TDM data transmit shift register Full Interval cha cha cha cha cha cha cha cha cha cha cha 1 2 3 4 1 2 3 4 1 2 3 6.3 串行口 6.3 串行口 TDM 端口结构 所有的TDM操作都同步于TFRM和TCLK.这俩信号一般由同一器件产

8、生。 6.3 串行口 Figure 932 TDM Serial Port Registers Diagram 15 14 13 12 11 10 9 8 7 MCMZTXM:决定使用外部或内部TCLK/TFRM; CH1-CH7:决定器件使用哪个时隙发送数据;为0表示该器件不发送 只接收; RA:接收地址/TA:发送地址; 接收方比较RA和TADD线上的TA (由发送方决定),确定是否接收; 若相同位置为丄,则接收;由此实现多对一,一对多的传送; X:确定当前为哪个时隙;S:表明当前帧接受数据的时隙;A:表明在 TADD线上最后釆到的地址值;TRCV Receive Data TDXR Tr

9、ansmit Data TSPC Free Soft X X XRDY RRDY INI INO RRST XRST TXM MCM X 0 0 TDM TCSR X X X X X X X X CH7 CH6 CH5 CH4 CH3 CH2 CH1 CHO TRTA TA7 TA6 TAS TA4 TA3 TA2 TA1 TAO RA7 RA6 RA5 RA4 RA3 RA2 RA1 RAO TRAD X X X2 X1 XO S2 S1 SO A7 A6 A5 A4 A3 A2 A1 AO 2 1 Figure 9-33 Serial Port Timing (TDM Mode) TCLK

10、 / TDAT 乂 曲17 X bitOy )4矽(乂brt3o址8()何皿0)15*也141 TADO JaOp 乂 ag 乂 a2g 严)S J_xt transrit interrupts by wrtttng 80h to IFR Eliminate arr/ interrupts tha: may have occurred before inroat zation. 3) Enable the TDM serial port intw rupts by ORing 0080h 阳Ih IMR. Enable tiagn 夏 interrupts 4) EnaWe iriterrup

11、ts globally (if nec sary) by clearing thG INTM bit irSTl. Interrupts must be globaly enabled for the CPL to respond 5) meOOOIhtoTCSR This selects time slot 0 as the transmission twne slot fbc this device 6) Mite OlOOhtoTRTA This sets up this device to transmit data to the device receiving al address

12、 01h It also seis up this device to ignoo al received data 7) Start the serial port by writing 349h to TSPC. This takes the transmit portion of the serial port out of reset and starts operations with the coajmcrs defined in s:e?s 1.5 and 6. 8) Perrorm a handsnake to venry trat the recef/ino deuce is

13、 ready tc recerve data. Fora sinote device pair, this could make use of BD arxs XF. For several devices this mtctn mean that xne device qeieratra TFRM and TCLK broadcasts a command to ail other leMces until each one retums an acknowledfie 9) SYhe the first data value to TDXR (i* not already done m s

14、tep 8) This initiates serial port transmit operatkxis sin:e TADD and TDAT are not driven i! new data is not written to TDXR. 丄复位.初始化TSPC; 2. 清除挂起的中断; 3. 使能IMR中响应中 断位; 4. INTM中断全局使 能; 5设置发送时隙; 6. 设置发送地址为04 7. 启动串口; 8. 执行握手协议: 9写数据到TDXR; 6.3 串行口 Exa/nple 46 TDM Serial Port Transmit Interrupt Service R

15、outirie Action Descnption 1) Save any context that may be modified on the stack The operating context of the intenupted oode musl be maintaine 2) Write TDXR with a new value from a pcadeteimined location in memory Write the new transmit data for the ISR 3) Restoco the context that was sawd in step (

16、 The operating context of the mterrupted code must be mamtame 4) Return from the ISR with an RETE to reenatile ititerrupts Interrupts must be reenalied foe the CFU to respond to the n interrupt. 1.保护现场 2写TDXR 3. 恢复现场 4. RETE 多通道带缓冲串行口 McBSP McBSP 是在缓冲串行口的基础上发展起来的。在外部 通道选择电路的控制下, 采用分时方式实现多路缓冲 串行通荷。 McBSP 串行口口 J 以与其他C54X 器件、编程器或其 他串口器件通信。 功能 全双工通信; 双缓冲的发送和三缓冲接收数据存储器,支持连续的数据流 传送; 独立的接收、发送帧和时钟信号; 可直接与工业标准的编码器、模拟界面芯片(AICs).其他串 行A/D、D/A器件连接并通信; McBSP工

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论