学习DSP外设之UART的配置和应用

本文详细介绍了如何配置DSP的UART外设,包括初始化步骤、数据发送和接收过程。初始化涉及设置波特率、FIFO、协议选择等;传输阶段讲解了UART如何根据LCR设置发送数据;接收部分阐述了数据接收和错误检测机制。通过中断管理和FIFO控制实现高效通信。
摘要由CSDN通过智能技术生成

一、Initialization

The following steps are required to initialize the UART:

0.给UART模块上电

1.Perform the necessary device pin multiplexing setup (see your device-specific data manual).

2.Set the desired baud rate by writing the appropriate clock divisor values to the divisor latch registers(DLL and DLH).

Divisor UART input clock frequency/(Desired baud rate 16)     当 MDR.OSM _ SEL 

Divisor UART input clock frequency/(Desired baud rate 13)     当 MDR.OSM _ SEL 

3.If the FIFOs will be used(FIFOEN =1 in FCR),The FIFOEN bit in FCR must be set first, before the other bits in FCR are configured. Select the desired trigger level and enable the FIFOs by writing the appropriate values to the FIFO control register (FCR).  Clear the transmitter FIFO and Receiver FIFO by set TXCLR=1 and RXCLR =1.

4.Choose the desired protocol settings by writing the appropriate values to the line control register(LCR).  e.g. set PEN =0(No PARITY),STB=0(1stop bit),WLS=0x3(8bits)

5.set IER controller if you need interrupt.

6.If autoflow control is desired, write appropriate values to the modem control register (MCR). Note thatall UARTs do not support autoflow control, see your d

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值