TMS320F28023最小系统原理图(含仿真器)

合集下载

TMS320F2812最小系统设计

TMS320F2812最小系统设计

TMS320F2812最小系统设计杨浩北,摘要在电子信息专业的课程教学、综合实验教学、毕业设计以及电子设计竞赛中, 需要应用DS P 实验系统。

本文以性价比高、在工业上广泛应用的T MS320F2812 为主控芯片, 设计了一个DSP 最小应用系统。

详细介绍了各部分电路的设计方法和调试过程。

该系统既可以满足教学要求, 又可用于简单的工程研究和应用开发。

关键词: 综合实验平台; DS P 最小系统; T MS320F28121 .系统结构一个典型的DSP 最小系统如图1 所示, 包括DSP 芯片、电源电路、复位电路、时钟电路及JT AG接口电路。

考虑到与PC 通信的需要, 最小系统一般还需增添串口通信电路。

T MS320 F2812 是TI 公司C2000 系列中性价比较高的一款器件。

该器件集成了丰富而又先进的外设, 如128kB 的Flash 存储器、4kB 的引导ROM、数学运算表、电机控制外设、串口通信外设、2kB 的OT P ROM 以及16 通道高性能12 位模数转换模块, 提供了两个采样保持电路可以实现双通道信号同步采样, 同时具有很高的运算精度( 32 位) 和系统处理能力( 达到150MIPS) , 可广泛应用于电力自动化、电机控制和变频家电等领域。

2 .系统硬件设计( 1) 电源及复位电路设计DSP 系统一般都采用多电源系统, 电源及复位电路的设计对于系统性能有重要影响。

TMS320 F2812 是一个较低功耗芯片, 核电压为1. 8V, IO 电压为3. 3V。

本文采用T I 公司的TPS767D318 电源芯片。

该芯片属于线性降压型DC/ DC 变换芯片, 可以由5V 电源同时产生两种不同的电压( 3. 3V、1. 8V 或2. 5V ) , 其最大输出电流为1000mA, 可以同时满足一片DSP 芯片和少量外围电路的供电需要, 如图2 所示。

该芯片自带电源监控及复位管理功能, 可以方便地实现电源及复位电路设计。

28335最小系统

28335最小系统

• 最大输出电流为1A时,最大电压差为 350mV 。
• 具有超低的典型静态电流(85μA),器件 无效状态时,静态电流仅为1μA 。
• 每路调整器各有一个开漏复位输出,复位 延迟时间为200ms 。
• 28引脚的TSSOP PowerPAD封装 。
• 每路调整器都有温度自动关闭保护功能 。
TPS767D301硬件电路图
UB
LB
OE
WE CE
IS61LV51216
PWM缓冲电路—74LVTH16245
由于CPU不具有驱动能力,控制功 率开关管的PWM驱动信号需要通过 缓冲芯片74LVTH16245驱动功率开 关管。也可以理解为增强CPU带负载 能力。
PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 PWM8 PWM9 PWM10 PWM11 PWM12 XCLKOUT A19
TLC2274A是一种满电源幅度输出四通道运算 放大器,可以提供相当好的AC性能,且有 较现存CMOS运放更好的噪声、输入失调 电压和功耗性能。器件的输入和输出设计 能够承受100mA的电流而不致锁住。器件 暴露于静电放电的情况下可能导致器件参 数性能衰退。
返回
ESD静电保护
国际上习惯将用于静电防护的器材统称为ESD ,即静电阻抗器。通过接触、摩擦、电器间感 应等产生,其特点是长时间积聚、高电压、低 电量、小电流和作用时间短。 EMI(电磁干扰) EMC(电磁兼容性)
引导(BOOT)ROM(8K X 16) 带有软件启动模式 数学运算表 16位或32位外部存储器扩展接口 多达2M的寻址空间 时钟和系统控制 支持动态改变锁相环的倍频系数 片上震荡器 看门狗定时模块
多达6通道的HRPWM输出 6个捕捉单元,捕捉外部事件 2个正交脉冲编码电路 8个32位/6个16位定时器 串口通信外设 1个串行外设接口模块(SPI) 3个UTAR接口模块(SCI) 2个增强型的eCAN2.0B接口模块

TMS320F2802x-Piccolo系列DSC原理及应用

TMS320F2802x-Piccolo系列DSC原理及应用

TMS320F28x-Piccolo系列DSC原理及应用HPL2019年4月1目录第1章 TMS320F2802X PICCOLO系列DSC概述11.1TMS320C28X TM内核简介1 1.1.1TMS320C28X TM的逻辑组成1 1.1.2TMS320C28X的特性1 1.2PICCOLO简介1 1.2.1TMS320F2802X系列P ICCOLO控制器1 1.2.2控制率加速器CLA2第2章时钟与系统控制32.1时钟和系统控制3 2.1.1使能/禁能外设模块的时钟3 2.1.2配置低速外设时钟预分频器4 2.2OSC和PLL模块4 2.2.1输入时钟选项4 2.2.2配置输入时钟源和XCLKOUT选项5 2.2.3配置器件时钟域5 2.2.4基于PLL的时钟模块6 2.2.5输入时钟故障检测6 2.2.6NMI中断和看门狗7 2.2.7XCLKOUT的产生8 2.2.8PLL控制、状态和XCLKOUT寄存器描述9 2.2.9外部振荡器基准时钟选项10 2.3低功率模式模块10 2.3.1自动从低功率模式唤醒的选择10 2.4CPU看门狗模块11 2.4.1服务看门狗定时器11 2.4.2看门狗复位或看门狗中断模式11 2.4.3低功率模式下看门狗的操作11 2.4.4仿真注意事项11 2.4.5看门狗寄存器11 2.532位CPU定时器0/1/212 2.6VREG/BOR/POR14 2.6.1片内稳压器(VREG)14 2.6.2片内上电复位(POR)和掉电复位(BOR)电路14 2.7外设帧14 2.7.1外设帧寄存器14 2.7.2EALLOW保护的寄存器15 2.7.3器件仿真寄存器16 2.7.4先写后读保护17第3章外设中断扩展(PIE)183.1PIE控制器的概述18 3.1.1中断操作顺序18 3.2向量表映射18 3.3中断源19 3.3.1处理多路复用中断的方法19 3.3.2使能和禁能多路复用外设中断的方法20 3.3.3从一个外设到CPU的多路复用中断请求的流程20 3.3.4PIE向量表21 3.4PIE配置寄存器23 3.5PIE中断寄存器23 3.5.1PIE中断标志寄存器23 3.5.2PIE中断使能寄存器24 3.5.3CPU中断标志寄存器(IFR)24 3.5.4中断使能寄存器(IER)和调试中断使能寄存器(DBGIER)24 3.6外部中断控制寄存器26第4章通用输入/输出(GPIO)274.1GPIO模块概述27 4.1.1JTAG端口27 4.2配置概述2724.3数字通用I/O控制28 4.4输入鉴定29 4.4.1不同步(异步输入)29 4.4.2只与SYSCLKOUT同步29 4.4.3使用一个采样窗口来鉴定29 4.5GPIO和外设多路复用(MUX)30 4.6寄存器位定义32第5章串行通信接口(SCI)425.1概述42 5.1.1增强型的SCI模块概述42 5.1.2结构43 5.2SCI寄存器47 5.2.1SCI模块寄存器汇总47 5.2.2SCI通信控制寄存器(SCICCR)48 5.2.3SCI控制寄存器1(SCICTL1)49 5.2.4SCI波特选择寄存器(SCIHBAUD,SCILBAUD)49 5.2.5SCI控制寄存器2(SCICTL2)50 5.2.6SCI接收器状态寄存器(SCIRXST)50 5.2.7接收器数据缓冲区寄存器(SCIRXEMU,SCIRXBUF)51 5.2.8SCI发送数据缓冲区寄存器(SCITXBUF)52 5.2.9SCI FIFO寄存器(SCIFFTX,SCIFFRX,SCIFFCT)52 5.2.10优先级控制寄存器(SCIPRI)54第6章串行外设接口(SPI)556.1增强型SPI模块概述55 6.1.1SPI结构方框图55 6.1.2SPI模块信号汇总56 6.2SPI模块寄存器概述56 6.3SPI的操作模式57 6.3.1操作简介57 6.3.2SPI模块的主模式和从模式57 6.4SPI中断58 6.4.1SPI中断控制位58 6.4.2数据格式58 6.4.3波特率和时钟模式59 6.4.4复位初始化操作60 6.4.5数据传送举例60 6.5SPI FIFO描述60 6.5.1SPI中断61 6.6SPI三线模式描述61 6.7SPI寄存器和波形62 6.7.1SPI控制寄存器62 6.7.2SPI实例的波形67第7章 I2C接口697.1I2C模块简介69 7.1.1特性69 7.1.2不支持的特性69 7.1.3功能概述69 7.1.4时钟发生70 7.2I2C模块操作细节70 7.2.1输入和输出电压电平70 7.2.2数据有效性70 7.2.3操作模式71 7.2.4I2C模块START和STOP条件71 7.2.5串行数据格式71 7.2.6产生NACK位72 7.2.7时钟同步72 7.2.8仲裁73 7.3I2C模块产生的中断请求73 7.3.1基本的I2C中断请求73 7.3.2I2C FIFO中断74 7.4复位和禁能I2C模块74 7.5I2C模块寄存器7437.5.1I2C模式寄存器(I2CMDR)74 7.5.2I2C中断使能寄存器(I2CIER)76 7.5.3I2C状态寄存器(I2CSTR)77 7.5.4I2C中断源寄存器(I2CISRC)79 7.5.5I2C预分频器寄存器(I2CPSC)79 7.5.6I2C时钟分频器寄存器(I2CCLKL和I2CCLKH)79 7.5.7I2C从机地址寄存器(I2CSAR)80 7.6I2C自身地址寄存器(I2COAR)80 7.6.1I2C数据计数寄存器(I2CCNT)80 7.6.2I2C数据接收寄存器(I2CDRR)81 7.6.3I2C数据发送寄存器(I2CDXR)81 7.6.4I2C发送FIFO寄存器(I2CFFTX)81 7.6.5I2C接收FIFO寄存器(I2CFFRX)82第8章模数转换器(ADC)838.1特性83 8.2结构方框图83 8.3SOC的工作原理83 8.3.1ADC采集(采样和保持)窗口84 8.3.2触发操作85 8.3.3通道选择85 8.4ADC转换极性85 8.5同步采样模式88 8.6EOC和中断操作88 8.7上电顺序88 8.8ADC校准(CALIBRATION)88 8.8.1厂家设置和校准功能89 8.8.2ADC零偏置校准89 8.8.3ADC满量程增益校准89 8.8.4ADC偏置电流校准90 8.9内部/外部参考电压的选择90 8.9.1内部参考电压90 8.9.2外部参考电压90 8.10ADC寄存器90 8.10.1ADC控制寄存器1(ADCCTL1)90 8.10.2ADC中断寄存器92 8.10.3ADC优先级寄存器94 8.10.4ADC SOC寄存器95 8.10.5ADC校准寄存器98 8.10.6ADC修订寄存器99 8.10.7ADC结果寄存器99 8.11ADC时序99第9章比较器模块(COMP)1029.1特性102 9.2结构框图102 9.3比较器功能102 9.4DAC基准102 9.5初始化102 9.6数字域的操作102 9.7比较器寄存器102 9.7.1比较器控制(COMPCTL)寄存器103 9.7.2比较器输出状态(COMPSTS)寄存器103 9.7.3DAC值(DACVAL)寄存器103第10章增强型脉宽调制器(EPWM)10410.1导言104 10.1.1概述104 10.1.2子模块概述104 10.1.3寄存器映射106 10.2EPWM子模块107 10.2.1概述107 10.2.2时基(TB)模块108 10.2.3计数器-比较(CC)子模块114 10.2.4计数器-比较子模块的用途114 10.2.5动作限定器(AQ)子模块117410.2.6死区发生器(DB)子模块124 10.2.7PWM斩波(PC)子模块127 10.2.8触发区(TZ)子模块129 10.2.9控制和监控触发区子模块129 10.2.10数字比较(DC)子模块134 10.2.11控制和监控数字比较子模块135 10.3电源拓扑的应用137 10.3.1多模块概述137 10.3.2主要的配置137 10.3.3控制多个频率不同的降压型转换器138 10.3.4控制多个频率相同的降压型转换器140 10.3.5控制多个半H桥(HHB)转换器141 10.3.6控制电动机的两个三相转换器(ACI和PMSM)142 10.3.7在各PWM模块间使用相位控制的实际应用144 10.3.8控制一个三相交错式DC/DC转换器145 10.3.9控制零电压开关的全桥(ZVSFB)转换器147 10.3.10控制一个峰值电流模式控制的降压模块148 10.3.11控制H桥LLC谐振转换器149 10.4寄存器151 10.4.1时基子模块的寄存器151 10.4.2计数器-比较子模块的寄存器154 10.4.3动作限定器子模块的寄存器156 10.4.4死区子模块的寄存器158 10.4.5PWM斩波子模块的控制寄存器159 10.4.6触发区子模块的控制寄存器和状态寄存器160 10.4.7数字比较子模块寄存器164 10.4.8事件触发器子模块寄存器168 10.4.9正确的中断初始化顺序170第11章高精度脉宽调制器(HRPWM)17211.1简介172 11.2HRPWM的操作描述172 11.2.1控制HRPWM功能173 11.2.2配置HRPWM174 11.2.3操作原理174 11.2.4尺度因子优化软件(SFO)178 11.2.5使用优化汇编代码的HRPWM示例178 11.3HRPWM寄存器描述181 11.3.1寄存器汇总181 11.3.2寄存器和字段描述181 11.4SFO库软件-SFO_TI_B UILD——V6.LIB184 11.4.1尺度因子优化程序函数- INT SFO()184 11.4.2软件使用185第12章增强型捕获模块(ECAP)18612.1简介186 12.2描述186 12.3捕获和APWM操作模式186 12.4捕获模式描述187 12.4.1事件预分频器187 12.4.2边沿极性选择和限定器188 12.4.3连续/单触发控制188 12.4.432位计数器和相位控制188 12.4.5CAP1-CAP4寄存器189 12.4.6中断控制189 12.4.7影像装载和锁定控制189 12.4.8APWM模式操作189 12.5捕获模式-控制和状态寄存器190 12.6寄存器映射196 12.7ECAP模块的应用196 12.7.1示例1-绝对时间戳操作,上升沿触发196 12.7.2示例2-绝对时间戳操作,上升沿和下降沿触发197 12.7.3示例3-时间差(D ELTA)操作,上升沿触发198 12.7.4示例4-时间差(D ELTA)操作,上升沿和下降沿触发199 12.8APWM模式的应用199 12.8.1示例1-简单PWM发生(独立通道)1995第13章引导ROM20113.1引导ROM概述201 13.1.1引导ROM存储器映射201 13.1.2片上引导ROM的IQ MATH表201 13.1.3片上引导ROM IQ MATH函数202 13.1.4片上F LASH API202 13.1.5CPU向量表202 13.2引导装载程序特性203 13.2.1引导装载程序函数操作203 13.2.2引导装载程序器件配置204 13.2.3PLL乘法器和DIVSEL选择204 13.2.4看门狗模块204 13.2.5执行ITRAP中断204 13.2.6内部上拉电阻204 13.2.7PIE配置204 13.2.8保留存储器204 13.2.9引导装载程序模式205 13.2.10D EVICE_C AL209 13.2.11引导装载程序数据流结构209 13.2.12基本传输过程211 13.2.13I NIT B OOT汇编例程212 13.2.14S ELECT B OOT M ODE函数212 13.2.15C OPY D ATA函数213 13.2.16SCI_B OOT函数214 13.2.17P ARALLEL_B OOT函数(GPIO)215 13.2.18SCI_B OOT函数217 13.2.19I2C B OOT函数219 13.2.20E XIT B OOT汇编例程221 13.3构建引导表222 13.3.1C2000十六进制实用程序222 13.3.2示例:为E CAN引导装载准备COFF文件222 13.4引导装载程序代码概述224 13.4.1引导ROM版本和校验和信息224 13.4.2引导装载程序代码修订历史224第14章 FLASH和OTP存储块22514.1F LASH和OTP存储器225 14.1.1F LASH存储器225 14.1.2OTP存储器225 14.2F LASH和OTP功率模式225 14.2.1F LASH和OTP性能226 14.2.2F LASH管道模式(PIPELINE MODE)226 14.2.3F LASH和OTP内保留的地址单元226 14.2.4更改F LASH配置寄存器的流程226 14.3F LASH和OTP寄存器227第15章代码安全模块(CSM)23015.1功能描述230 15.2CSM对其它片内资源的影响230 15.3将代码安全与用户应用相结合231 15.3.1需要安全解锁的环境231 15.3.2密码匹配流程232 15.3.3带有/没有代码保护的器件的取消保护注意事项232 15.4保护安全逻辑必须执行的操作和不能执行的操作233 15.4.1必须执行的操作233 15.4.2不能执行的操作233 15.5CSM特性小结2336第1章TMS320F2802x Piccolo系列DSC概述1.1 TMS320C28x TM内核简介TMS320C28x TM是一款低功耗的32位定点处理器内核。

DSP最小系统设计报告

DSP最小系统设计报告

DSP最小系统报告一.TMS320F2812最小系统1.1TMS320F2812最小系统TMS320F2812的最小系统如图1-1所示。

电路主要由TMS320F2812芯片、30MHz有源晶振和电路电源以及电容、电阻电感等少量器件构成。

另外,考虑到DSP在下载时需要下载端口,所以在最小系统上加一个14脚的JTAG仿真烧写口。

该最小系统不管是在仿真模式下还是在实时模式下,都能够正常运行。

一般来说,在设计电源的而过程中,模拟地和数字地最后通过电感连接起来,电源和地通过电容连接起来。

图1-1 TMS320F2812最小系统1.2 电源电路的设计TMS320X2812工作时所要求的电压分为两部分:3.3V的Flash电压和1.8V 的内核电压。

TMS320X2812对电源很敏感,所以在此推荐选择电压精度比较高的电源芯片TPS767D301或者TPS767D318。

TPS767D301芯片的输入电压为+5V,芯片起振,正常工作之后,能够产生3.3V和1.8V的两种电压供DSP使用。

图1-2 电源电路1.3 JTAG下载口电路及复位电路考虑到TPS767D301芯片能够自身产生复位信号,此复位信号可直接供DSP芯片使用,所以不用为DSP设置专门的复位芯片。

复位芯片与DSP芯片的连接如上电路图。

而对于JTAG电路,在实际设计过程中,需要考虑到JTAG 下载口的抗干扰性,在与DSP相连接的端口需要采用上拉设计,JTAG电路如下图所示。

图1-3-1 JTAG下载口电路图1-3-2 复位电路二.外设电路我设计的流水灯电路使用了GPIOA0到GPIOA4的五个端口,其中GPIOA0到GPIOA4的5个IO口输出连接LED的5个灯。

最后的实验结果:5个LED灯被循环点亮。

图2-1 LED流水灯三.程序3.1 CMD文件MEMORY{PAGE 0 :PRAMH0 : origin = 0x3f8000, length = 0x001000PAGE 1 :/* SARAM */RAMM0 : origin = 0x000000, length = 0x000400RAMM1 : origin = 0x000400, length = 0x000400/* Peripheral Frame 0: */DEV_EMU : origin = 0x000880, length = 0x000180FLASH_REGS : origin = 0x000A80, length = 0x000060 CSM : origin = 0x000AE0, length = 0x000010 XINTF : origin = 0x000B20, length = 0x000020CPU_TIMER0 : origin = 0x000C00, length = 0x000008 CPU_TIMER1 : origin = 0x000C08, length = 0x000008 CPU_TIMER2 : origin = 0x000C10, length = 0x000008 PIE_CTRL : origin = 0x000CE0, length = 0x000020 PIE_VECT : origin = 0x000D00, length = 0x000100 /* Peripheral Frame 1: */ECAN_A : origin = 0x006000, length = 0x000100 ECAN_AMBOX : origin = 0x006100, length = 0x000100 /* Peripheral Frame 2: */SYSTEM : origin = 0x007010, length = 0x000020 SPI_A : origin = 0x007040, length = 0x000010SCI_A : origin = 0x007050, length = 0x000010XINTRUPT : origin = 0x007070, length = 0x000010 GPIOMUX : origin = 0x0070C0, length = 0x000020 GPIODAT : origin = 0x0070E0, length = 0x000020 ADC : origin = 0x007100, length = 0x000020EV_A : origin = 0x007400, length = 0x000040EV_B : origin = 0x007500, length = 0x000040SPI_B : origin = 0x007740, length = 0x000010SCI_B : origin = 0x007750, length = 0x000010MCBSP_A : origin = 0x007800, length = 0x000040 /* CSM Password Locations */CSM_PWL : origin = 0x3F7FF8, length = 0x000008 /* SARAM */DRAMH0 : origin = 0x3f9000, length = 0x001000 }SECTIONS{/* Allocate program areas: */.reset : > PRAMH0, PAGE = 0.text : > PRAMH0, PAGE = 0.cinit : > PRAMH0, PAGE = 0/* Allocate data areas: */.stack : > RAMM1, PAGE = 1.bss : > DRAMH0, PAGE = 1.ebss : > DRAMH0, PAGE = 1.const : > DRAMH0, PAGE = 1.econst : > DRAMH0, PAGE = 1.sysmem : > DRAMH0, PAGE = 1/* Allocate Peripheral Frame 0 Register Structures: */DevEmuRegsFile : > DEV_EMU, PAGE = 1FlashRegsFile : > FLASH_REGS, PAGE = 1CsmRegsFile : > CSM, PAGE = 1XintfRegsFile : > XINTF, PAGE = 1CpuTimer0RegsFile : > CPU_TIMER0, PAGE = 1CpuTimer1RegsFile : > CPU_TIMER1, PAGE = 1CpuTimer2RegsFile : > CPU_TIMER2, PAGE = 1PieCtrlRegsFile : > PIE_CTRL, PAGE = 1PieVectTable : > PIE_VECT, PAGE = 1/* Allocate Peripheral Frame 2 Register Structures: */ECanaRegsFile : > ECAN_A, PAGE = 1ECanaMboxesFile : > ECAN_AMBOX PAGE = 1/* Allocate Peripheral Frame 1 Register Structures: */SysCtrlRegsFile : > SYSTEM, PAGE = 1SpiaRegsFile : > SPI_A, PAGE = 1SciaRegsFile : > SCI_A, PAGE = 1XIntruptRegsFile : > XINTRUPT, PAGE = 1GpioMuxRegsFile : > GPIOMUX, PAGE = 1GpioDataRegsFile : > GPIODAT PAGE = 1AdcRegsFile : > ADC, PAGE = 1EvaRegsFile : > EV_A, PAGE = 1EvbRegsFile : > EV_B, PAGE = 1ScibRegsFile : > SCI_B, PAGE = 1McbspaRegsFile : > MCBSP_A, PAGE = 1/* CSM Password Locations */CsmPwlFile : > CSM_PWL, PAGE = 1}3.2 系统初始化函数#include "DSP28_Device.h"//---------------------------------------------------------------------------// InitSysCtrl://---------------------------------------------------------------------------// This function initializes the System Control registers to a known state.//void InitSysCtrl(void){Uint16 i;EALLOW;SysCtrlRegs.WDCR = 0x0068; //禁止看门狗模块SysCtrlRegs.PLLCR = 0xA;for(i= 0; i< 5000; i++){} //延时,使得PLL模块能够完成初始化操作//高速时钟预定标器和低速时钟预定标器,产生高速外设时钟HSPCLK和低速外设时钟LSPCLKSysCtrlRegs.HISPCP.all = 0x0001;SysCtrlRegs.LOSPCP.all = 0x0002;EDIS;}3.3GPIO初始化函数//// TMDX ALPHA RELEASE// Intended for product evaluation purposes////#################################################################### #######//// FILE: DSP28_Gpio.c//// TITLE: DSP28 General Purpose I/O Initialization & Support Functions.////#################################################################### #######//// Ver | dd mmm yyyy | Who | Description of changes//=====|=============|======|==================================== ===========// 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release// 0.56| 20 May 2002 | L.H. | No change// 0.57| 27 May 2002 | L.H. | No change//#################################################################### ########include "DSP28_Device.h"//---------------------------------------------------------------------------// InitGpio://---------------------------------------------------------------------------// This function initializes the Gpio to a known state.//void InitGpio(void){EALLOW;GpioMuxRegs.GPAMUX.bit.PWM1GPIOA0 = 0;GpioMuxRegs.GPADIR.bit.GPIOA0 = 1;GpioMuxRegs.GPAMUX.bit.PWM2GPIOA1 = 0;GpioMuxRegs.GPADIR.bit.GPIOA1= 1;GpioMuxRegs.GPAMUX.bit.PWM3GPIOA2= 0;GpioMuxRegs.GPADIR.bit.GPIOA2= 1;GpioMuxRegs.GPAMUX.bit.PWM4GPIOA3= 0;GpioMuxRegs.GPADIR.bit.GPIOA3= 1;GpioMuxRegs.GPAMUX.bit.PWM5GPIOA4= 0;GpioMuxRegs.GPADIR.bit.GPIOA4= 1;EDIS;}3.4 主函数#include "DSP28_Device.h"void main(void){int kk=0;InitSysCtrl(); //初始化系统函数DINT;IER=Ox0000; //禁止CPU中断IFR=Ox0000; //清除CPU中断标志InitPieCtrl(); //初始化PIE控制寄存器InitPieVectTable(); //初始化PIE中断向量表InitGpio(); //初始化GPIO口while(1){GpioDataRegs.GPACLEAR.bit.GPIOA0 = 1; //PWM1引脚输出低电平,LED1灯亮for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPASET.bit.GPIOA0 = 1; //PWM1引脚输出高电平,LED1灯灭for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPACLEAR.bit.GPIOA1 = 1; //PWM2引脚输出低电平,LED2灯亮for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPASET.bit.GPIOA1 = 1; //PWM2引脚输出高电平,LED2灯灭for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPACLEAR.bit.GPIOA2 = 1; //PWM3引脚输出低电平,LED3灯亮for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPASET.bit.GPIOA2 = 1; //PWM3引脚输出高电平,LED3灯灭for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPACLEAR.bit.GPIOA3 = 1; //PWM4引脚输出低电平,LED4灯亮for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPASET.bit.GPIOA3 = 1; //PWM4引脚输出高电平,LED4灯灭for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPACLEAR.bit.GPIOA4 = 1; //PWM5引脚输出低电平,LED5灯亮for(kk=0;kk<100;kk++)delay_loop(); //延时保持GpioDataRegs.GPASET.bit.GPIOA4 = 1; //PWM5引脚输出高电平,LED5灯灭for(kk=0;kk<100;kk++)delay_loop(); //延时保持}}void delay_loop(){short i;for(i=0;i<30000;i++){}}。

TMS320F2802x_Piccolo系列DSC原理及应用

TMS320F2802x_Piccolo系列DSC原理及应用

目录第1章TMS320F2802x Piccolo系列DSC概述 (1)1.1 TMS320C28x TM内核简介 (1)1.1.1 TMS320C28x TM的逻辑组成 (1)1.1.2 TMS320C28x的特性 (2)1.2 Piccolo简介 (3)1.2.1 TMS320F2802x系列Piccolo控制器 (3)1.2.2 TMS320F2803x系列Piccolo控制器 (4)1.2.3 Piccolo选型指南 (7)第2章时钟与系统控制 (9)2.1 时钟和系统控制 (9)2.1.1 使能/禁能外设模块的时钟 (10)2.1.2 配置低速外设时钟预分频器 (13)2.2 OSC和PLL模块 (13)2.2.1 输入时钟选项 (14)2.2.2 配置输入时钟源和XCLKOUT选项 (16)2.2.3 配置器件时钟域 (17)2.2.4 基于PLL的时钟模块 (21)2.2.5 输入时钟故障检测 (21)2.2.6 NMI中断和看门狗 (24)2.2.7 XCLKOUT的产生 (27)2.2.8 PLL控制(PLLCR)寄存器 (27)2.2.9 PLL控制、状态和XCLKOUT寄存器描述 (29)2.2.10 外部振荡器基准时钟选项 (33)2.3 低功率模式模块 (33)2.3.1 自动从低功率模式唤醒的选择 (35)2.4 CPU看门狗模块 (36)2.4.1 服务看门狗定时器 (36)2.4.2 看门狗复位或看门狗中断模式 (37)2.4.3 低功率模式下看门狗的操作 (37)2.4.4 仿真注意事项 (38)2.4.5 看门狗寄存器 (38)2.5 32位CPU定时器0/1/2 (41)2.6 VREG/BOR/POR (47)2.6.1 片内稳压器(VREG) (47)2.6.2 片内上电复位(POR)和掉电复位(BOR)电路 (47)2.7 外设帧 (47)2.7.1 外设帧寄存器 (47)2.7.2 EALLOW保护的寄存器 (49)2.7.3 器件仿真寄存器 (53)2.7.4 先写后读保护 (55)第3章外设中断扩展(PIE) (57)3.1 PIE控制器的概述 (57)3.1.1 中断操作顺序 (57)3.2 向量表映射 (60)3.3 中断源 (62)3.3.1 处理多路复用中断的方法 (63)3.3.2 使能和禁能多路复用外设中断的方法 (64)3.3.3 从一个外设到CPU的多路复用中断请求的流程 (65)3.3.4 PIE向量表 (66)3.4 PIE配置寄存器 (75)3.5 PIE中断寄存器 (77)3.5.1 PIE中断标志寄存器 (78)3.5.2 PIE中断使能寄存器 (78)3.5.3 CPU中断标志寄存器(IFR) (79)3.5.4 中断使能寄存器(IER)和调试中断使能寄存器(DBGIER) (82)3.6 外部中断控制寄存器 (86)第4章通用输入/输出(GPIO) (89)4.1 GPIO模块概述 (89)4.1.1 JTAG端口 (90)4.2 配置概述 (91)4.3 数字通用I/O控制 (94)4.4 输入鉴定 (96)4.4.1 不同步(异步输入) (96)4.4.2 只与SYSCLKOUT同步 (96)4.4.3 使用一个采样窗口来鉴定 (96)4.5 GPIO和外设多路复用(MUX) (99)4.6 寄存器位定义 (103)第5章串行通信接口(SCI) (122)5.1 概述 (122)5.1.1 增强型的SCI模块概述 (122)5.1.2 结构 (125)5.2 SCI寄存器 (137)5.2.1 SCI模块寄存器汇总 (137)5.2.2 SCI通信控制寄存器(SCICCR) (138)5.2.3 SCI控制寄存器1(SCICTL1) (140)5.2.4 SCI波特选择寄存器(SCIHBAUD, SCILBAUD) (143)5.2.5 SCI控制寄存器2(SCICTL2) (145)5.2.6 SCI接收器状态寄存器(SCIRXST) (146)5.2.7 接收器数据缓冲区寄存器(SCIRXEMU,SCIRXBUF) (149)5.2.8 SCI发送数据缓冲区寄存器(SCITXBUF) (151)5.2.9 SCI FIFO寄存器(SCIFFTX, SCIFFRX, SCIFFCT) (151)5.2.10 优先级控制寄存器(SCIPRI) (155)第6章串行外设接口(SPI) (157)6.1 增强型SPI模块概述 (157)6.1.1 SPI结构方框图 (158)6.1.2 SPI模块信号汇总 (159)6.2 SPI模块寄存器概述 (160)6.3 SPI的操作模式 (161)6.3.1 操作简介 (161)6.3.2 SPI模块的主模式和从模式 (162)6.4 SPI中断 (163)6.4.1 SPI中断控制位 (163)6.4.2 数据格式 (164)6.4.3 波特率和时钟模式 (164)6.4.4 复位初始化操作 (167)6.4.5 数据传送举例 (168)6.5 SPI FIFO描述 (169)6.5.1 SPI中断 (170)6.6 SPI三线模式描述 (170)6.7 SPI寄存器和波形 (174)6.7.1 SPI控制寄存器 (174)6.7.2 SPI实例的波形 (185)第7章I2C接口 (189)7.1 I2C模块简介 (189)7.1.1 特性 (189)7.1.2 不支持的特性 (190)7.1.3 功能概述 (190)7.1.4 时钟发生 (191)7.2 I2C模块操作细节 (192)7.2.1 输入和输出电压电平 (192)7.2.2 数据有效性 (192)7.2.3 操作模式 (193)7.2.4 I2C模块START和STOP条件 (194)7.2.5 串行数据格式 (195)7.2.6 产生NACK位 (197)7.2.7 时钟同步 (198)7.2.8 仲裁 (199)7.3 I2C模块产生的中断请求 (199)7.3.1 基本的I2C中断请求 (199)7.3.2 I2C FIFO中断 (201)7.4 复位和禁能I2C模块 (201)7.5 I2C模块寄存器 (201)7.5.1 I2C模式寄存器(I2CMDR) (202)7.5.2 I2C中断使能寄存器(I2CIER) (210)7.5.3 I2C状态寄存器(I2CSTR) (212)7.5.4 I2C中断源寄存器(I2CISRC) (218)7.5.5 I2C预分频器寄存器(I2CPSC) (220)7.5.6 I2C时钟分频器寄存器(I2CCLKL和I2CCLKH) (221)7.5.7 I2C从机地址寄存器(I2CSAR) (222)7.6 I2C自身地址寄存器(I2COAR) (223)7.6.1 I2C数据计数寄存器(I2CCNT) (223)7.6.2 I2C数据接收寄存器(I2CDRR) (224)7.6.3 I2C数据发送寄存器(I2CDXR) (224)7.6.4 I2C发送FIFO寄存器(I2CFFTX) (225)7.6.5 I2C接收FIFO寄存器(I2CFFRX) (227)第8章模数转换器(ADC) (229)8.1 特性 (229)8.2 结构方框图 (229)8.3 SOC的工作原理 (230)8.3.1 ADC采集(采样和保持)窗口 (232)8.3.2 触发操作 (233)8.3.3 通道选择 (234)8.4 ADC转换极性 (234)8.5 同步采样模式 (238)8.6 EOC和中断操作 (238)8.7 上电顺序 (239)8.8 ADC校准(calibration) (239)8.8.1 厂家设置和校准功能 (241)8.8.2 ADC零偏置校准 (241)8.8.3 ADC满量程增益校准 (241)8.8.4 ADC偏置电流校准 (243)8.9 内部/外部参考电压的选择 (243)8.9.1 内部参考电压 (243)8.9.2 外部参考电压 (243)8.10 ADC寄存器 (243)8.10.1 ADC控制寄存器1(ADCCTL1) (244)8.10.2 ADC中断寄存器 (249)8.10.3 ADC优先级寄存器 (253)8.10.4 ADC SOC寄存器 (255)8.10.5 ADC校准寄存器 (264)8.10.6 ADC修订寄存器 (265)8.10.7 ADC结果寄存器 (265)8.11 ADC时序 (266)第9章比较器模块(COMP) (270)9.1 特性 (270)9.2 结构框图 (270)9.3 比较器功能 (270)9.4 DAC基准 (271)9.5 初始化 (271)9.6 数字域的操作 (271)9.7 比较器寄存器 (271)9.7.1 比较器控制(COMPCTL)寄存器 (272)9.7.2 比较器输出状态(COMPSTS)寄存器 (274)9.7.3 DAC值(DACV AL)寄存器 (274)第10章增强型脉宽调制器(ePWM) (275)10.1 导言 (275)10.1.1 概述 (275)10.1.2 子模块概述 (275)10.1.3 寄存器映射 (279)10.2 ePWM子模块 (283)10.2.1 概述 (283)10.2.2 时基(TB)模块 (285)10.2.3 计数器-比较(CC)子模块 (296)10.2.4 计数器-比较子模块的用途 (296)10.2.5 动作限定器(AQ)子模块 (301)10.2.6 死区发生器(DB)子模块 (317)10.2.7 PWM斩波(PC)子模块 (322)10.2.8 触发区(TZ)子模块 (326)10.2.9 控制和监控触发区子模块 (327)10.2.10 数字比较(DC)子模块 (336)10.2.11 控制和监控数字比较子模块 (337)10.3 电源拓扑的应用 (342)10.3.1 多模块概述 (342)10.3.2 主要的配置 (342)10.3.3 控制多个频率不同的降压型转换器 (343)10.3.4 控制多个频率相同的降压型转换器 (347)10.3.5 控制多个半H桥(HHB)转换器 (349)10.3.6 控制电动机的两个三相转换器(ACI和PMSM) (352)10.3.7 在各PWM模块间使用相位控制的实际应用 (356)10.3.8 控制一个三相交错式DC/DC转换器 (357)10.3.9 控制零电压开关的全桥(ZVSFB)转换器 (361)10.3.10 控制一个峰值电流模式控制的降压模块 (363)10.3.11 控制H桥LLC谐振转换器 (365)10.4 寄存器 (368)10.4.1 时基子模块的寄存器 (368)10.4.2 计数器-比较子模块的寄存器 (376)10.4.3 动作限定器子模块的寄存器 (381)10.4.4 死区子模块的寄存器 (386)10.4.5 PWM斩波子模块的控制寄存器 (388)10.4.6 触发区子模块的控制寄存器和状态寄存器 (390)10.4.7 数字比较子模块寄存器 (397)10.4.8 事件触发器子模块寄存器 (405)10.4.9 正确的中断初始化顺序 (409)第11章高精度脉宽调制器(HRPWM) (417)11.1 简介 (417)11.2 HRPWM的操作描述 (418)11.2.1 控制HRPWM功能 (419)11.2.2 配置HRPWM (421)11.2.3 操作原理 (422)11.2.4 尺度因子优化软件(SFO) (429)11.2.5 使用优化汇编代码的HRPWM示例 (429)11.3 HRPWM寄存器描述 (434)11.3.1 寄存器汇总 (434)11.3.2 寄存器和字段描述 (435)11.4 SFO库软件-SFO_TI_Build——V6.lib (443)11.4.1 尺度因子优化程序函数- intSFO() (443)11.4.2 软件使用 (445)第12章增强型捕获模块(eCAP) (448)12.1 简介 (448)12.2 描述 (448)12.3 捕获和APWM操作模式 (448)12.4 捕获模式描述 (450)12.4.1 事件预分频器 (450)12.4.2 边沿极性选择和限定器 (451)12.4.3 连续/单触发控制 (451)12.4.4 32位计数器和相位控制 (452)12.4.5 CAP1-CAP4寄存器 (453)12.4.6 中断控制 (453)12.4.7 影像装载和锁定控制 (454)12.4.8 APWM模式操作 (455)12.5 捕获模式-控制和状态寄存器 (456)12.6 寄存器映射 (466)12.7 ECAP模块的应用 (467)12.7.1 示例1-绝对时间戳操作,上升沿触发 (468)12.7.2 示例2-绝对时间戳操作,上升沿和下降沿触发 (470)12.7.3 示例3-时间差(Delta)操作,上升沿触发 (471)12.7.4 示例4-时间差(Delta)操作,上升沿和下降沿触发 (473)12.8 APWM模式的应用 (474)12.8.1 示例1-简单PWM发生(独立通道) (474)第13章引导ROM (476)13.1 引导ROM概述 (476)13.1.1 引导ROM存储器映射 (476)13.1.2 片上引导ROM的IQmath表 (476)13.1.3 片上引导ROM IQmath函数 (479)13.1.4 片上Flash API (479)13.1.5 CPU向量表 (479)13.2 引导装载程序特性 (481)13.2.1 引导装载程序函数操作 (481)13.2.2 引导装载程序器件配置 (482)13.2.3 PLL乘法器和DIVSEL选择 (483)13.2.4 看门狗模块 (484)13.2.5 执行ITRAP中断 (484)13.2.6 内部上拉电阻 (484)13.2.7 PIE配置 (484)13.2.8 保留存储器 (484)13.2.9 引导装载程序模式 (485)13.2.10 Device_Cal (492)13.2.11 引导装载程序数据流结构 (493)13.2.12 基本传输过程 (497)13.2.13 InitBoot汇编例程 (498)13.2.14 SelectBootMode函数 (499)13.2.15 CopyData函数 (501)13.2.16 SCI_Boot函数 (502)13.2.17 Parallel_Boot函数(GPIO) (504)13.2.18 SCI_Boot函数 (508)13.2.19 I2C Boot函数 (511)13.2.20 ExitBoot汇编例程 (515)13.3 构建引导表 (516)13.3.1 C2000十六进制实用程序 (516)13.3.2 示例:为eCAN引导装载准备COFF文件 (518)13.4 引导装载程序代码概述 (520)13.4.1 引导ROM版本和校验和信息 (520)13.4.2 引导装载程序代码修订历史 (521)第14章Flash和OTP存储块 (522)14.1 Flash和OTP存储器 (522)14.1.1 Flash存储器 (522)14.1.2 OTP存储器 (522)14.2 Flash和OTP功率模式 (522)14.2.1 Flash和OTP性能 (524)14.2.2 Flash管道模式(pipeline mode) (525)14.2.3 Flash和OTP内保留的地址单元 (526)14.2.4 更改Flash配置寄存器的流程 (526)14.3 Flash和OTP寄存器 (527)第15章代码安全模块(CSM) (534)15.1 功能描述 (534)15.2 CSM对其它片内资源的影响 (536)15.3 将代码安全与用户应用相结合 (537)15.3.1 需要安全解锁的环境 (538)15.3.2 密码匹配流程 (539)15.3.3 带有/没有代码保护的器件的取消保护注意事项 (540)15.4 保护安全逻辑必须执行的操作和不能执行的操作 (542)15.4.1 必须执行的操作 (542)15.4.2 不能执行的操作 (542)15.5 CSM特性小结 (542)参考文献 (543)附录A 版本信息 (544)附录B 版权声明 (545)第1章TMS320F2802x Piccolo系列DSC概述1.1 TMS320C28x TM内核简介TMS320C28x TM是一款低功耗的32位定点处理器内核。

TMS32028335原理图

TMS32028335原理图

GPIO19 SPI STEA GPIO18/SPI CLKS GPIO17/SPI SOMIA GPIO16/SPI SIMOA XCLKOUT XCLKIN X1 X2
63 62 28 27 138 105 104
CANTXA SPI STEB CANRXA SPI CLKB GPIO17 SPI SOMIB GPIO16 SPI SIMOB
+
VCC 2 3 1 R72 5V指示灯 470 GND +5v 1 2 3 Z
S1 6 5 4 B 6 1 5 2 4 3 SW
R73 R74 330 C34
+3.3V C9
+
3.3V指示灯 D10 GND +3.3V
10uF 104
C10 10uF
GND GND PWMA1 PWMA2 PWMA3 PWMA4 PWMA5 PWMA6 +5v P5 GPIO64 GPIO66 GPIO68 ADCINA0 ADCINA2 ADCINA4 ADCINA6 1 3 5 7 9 11 13 15 2 4 6 8 10 12 14 16 GND P2 1 2 3 4 5 6 7 8 9 10 11 12 C13 104 GPIO65 GPIO67 GPIO69 ADCINA1 ADCINA3 ADCINA5 ADCINA7 GND GND PWMB1 PWMB2 PWMB3 PWMB4 PWMB5 PWMB6 GND
D1 VSS VCC VO RS(CS) R/W(SID) E(SCLK) DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 PSB NC RESET VOUT A K
通用12864显示
GND
ADCINA7 ADCINA6 ADCINA5 ADCINA4 ADCINA3 ADCINA2 ADCINA1 ADCINA0 ADCINB0 ADCINB1 ADCINB2 ADCINB3 ADCINB4 ADCINB5 ADCINB6 ADCINB7

TMS320最小系统

TMS320最小系统

R7 R8 3.3K 3.3K
GND S2
1
4
R9 R10 820R 820R
VCC GND
8 7 SCL 6 SDA5
VCC AD0 WP AD1 SCL AD2 SDA GND
1 2 3 4
TDO
58 TDO
SPISTEB/TZ1/GPIO-15 75
TDO
2
3
JTAG接口
SW DIP-2
bootloader选择
1
2
3
4
5
6
7
8
3.3V
A
C4
1uf
GND
VDDA
L1 BLM21PG221SN1D L2 BKP2125HS600-T
C1
C2
C3
2.2uf 2.2uf 2.2uf
设 计 的 为 TMS320F280 35的 最 小 系 统 版 ( 1) 内 部 的 数 字 供 电 采 用 内 部 的 VREG供 电 , 从 而 VREGENZ接 口 通 过 一 个 0电 阻 接 地 。 ( 2) 使 用 的 为 外 部 接 10MHZ的 无 源 晶 振 , 配 合 片 内 振 荡 器 之 后 , 提 供 时 钟 信 号 。 ( 3) 预 留 了 JTAG的 仿 真 接 口 , 对 于 28035的 接 口 有 自 己 的 协 议 , 可 以 参 照 数 据 手 册 。 ( 4) ADC的 参 考 电 压 源 使 用 的 为 内 部 参 考 电 压 。 ( 5) 内 核 与 GPIO的 电 压 采 用 不 同 的 供 应 方 式 , 模 拟 电 压 为 3.3V, 内 核 与 GPIO为 1.8V, VDD与VDDIO则是为了解决这一问题而设置的。VDDIO连 接到VREG中,稳 出一个1.8V 的电压给系统供电,也避免了上电顺序的问题。

基于TMS320F2802的变频器方案

基于TMS320F2802的变频器方案

基于TMS320F2802的变频器方案1、讲述内容我们为何选择TI的TMS320F2802作为变频器主控芯片?我们怎样在TMS320F2802上实现变频器控制方案?我们的基于TMS320F2802的变频器方案的产品分类及其特点。

Q&A。

2、我们为何选择TI的TMS320F2802作为变频器主控芯片①现在变频器的主控芯片可能有以下几种选择:基于MCU方案(Intel的N87C196MC、瑞萨单片机等);基于16位DSP方案(TI的TMS320F240x等);基于32位DSP方案(TI的TMS320F28xx等)。

下面我们将在16位DSP和32位DSP中间作一个比较,因为TI的TMS320F2812系列DSP虽然是32位机,但其成本太高(超过20美元),所以我们暂不予考虑,这里以TMS320F240x 和TMS320F2802为例。

②处理器的运算速度TMS320F2802为100MHz(TMS320F2802-60为60MHz),而TMS320LF240x最高为40MHz。

在变频器这样一个多变量、多任务的系统中,尤其是如果采用电压空间矢量控制算法(SVPWM)、矢量控制、直接转矩控制(DTC)算法的话,要求的运算数据量更大。

显然TMS320F2802不管是在SPWM算法中还是升级到SVPWM、矢量控制、DTC等算法都会有更好的性能。

③内核区别TMS320F2802是采用32位的C28x内核,具有以下特点:指令采用原子操作:指令长度更短,执行更有效,可以在相同的代码长度下,执行更多有效指令;带有单周期的双16*16和单32*32位的硬件乘法器:单个时钟周期内完成32位数据乘法,更适合于适时PID运算、在线运算SPWM数据、各种要求小数格式的数据处理,且精度高,可以做到真正0.01Hz的精确度;超快速的中断结构和响应:使系统保护、功能响应更有效,更快。

相比之下,TMS320F240x是16位的C24x内核,执行32位乘法至少比C28x要慢8倍以上,指令执行是4流水线形式,比C28x的8流水线原子操作慢,数据处理上不方便在线处理运算SPWM数据,需要预先算好表格,因此修改很不方便,精度受表格数据精确性影响不易很精确。

TMS320F2802x_2803x

TMS320F2802x_2803x

Application ReportSPRABJ2–March2011 TMS320F2802x/TMS320F2803x to TMS320F2806xMigration Overview Katie EnderleABSTRACTThis application report describes differences between Texas Instruments'TMS320F2802x/2803x and TMS320F2806x microcontrollers to assist in application migration.While the main focus of this document is migration from2802x/2803x to2806x,this document is also useful if you are considering migrating in the reverse direction.Functions that are identical in both devices are not necessarily included.All efforts have been made to provide a comprehensive list of the differences between the two device groups in the C28x™generation.Contents1Introduction (2)2Central Processing Unit(CPU) (2)3Development Tools (3)4Package and Pinout (4)5Operating Frequency (4)6Supply Voltage and Power Sequencing (5)7Memory Map (5)8Clocks and System Control (7)9Peripherals (8)10Interrupts (12)11Errata Fixes (12)12References (12)List of Tables1SARAM Addresses (5)2Sector Configuration Per Device (6)3New,Updated,and Removed Registers (7)4New,Updated,and Removed Registers (11)Introduction 1IntroductionThe TMS320F2802x,TMS320F2803x,and TMS320F2806x devices are members of the C2000™Piccolo MCU platform for use within embedded control applications.The TMS320F2806x features the sameenhanced control peripherals available on the TMS230F2802x and2803x devices.In addition,the2806x features:•Direct memory access(DMA)•Viterbi Complex Math and CRC Unit(VCU)•Multichannel Buffered Serial Port(McBSP)•High-Resolution Capture(HRCAP)•USB controller+PHY•Floating-Point Unit(FPU)•Additional enhanced quadrature encoder pulse(eQEP)and enhanced capture(eCAP)peripheralsThese new peripherals enable the firmware engineer to solve challenging control problems effectively.For purposes of migration,these devices can be classified into two groups:•TMS320F2802x and TMS320F2803x.This group will be referenced as2802x/2803x.•TMS320F2806x.This group will be referenced as2806x.For a full list of devices currently available within the2802x,2803x,and2806x family,see the TI website at /.As the focus of this document is to describe the differences between the two device groups,thedescriptions are explained only to the extent of highlighting areas that require attention when moving an application from one device to the other.For a detailed description of features specific to each device,see the device-specific data manuals and user's guides available on the TI website at /.This application report does not cover the silicon exceptions or advisories that may be present on each device.Consult the following silicon erratas for specific advisories and workarounds:•TMS320F28069,TMS320F28068,TMS320F28067,TMS320F28066,TMS32028065,TMS320F28064, TMS320F28063,TMS320F28062Piccolo MCU Silicon Errata(SPRZ342)•TMS320F28030,TMS320F28031,TMS320F28032,TMS320F28033,TMS320F28034, TMS320F28035Piccolo MCU Silicon Errata(SPRZ295)•TMS320F28027,TMS320F28026,TMS320F28023,TMS320F28022,TMS320F28021, TMS320F28020,TMS320F280200Piccolo MCU Silicon Errata(SPRZ292)NOTE:Always refer to the TMS data manual for information regarding any electrical specifications.2Central Processing Unit(CPU)The2806x devices are the first Piccolo devices to include the C28x+floating-point unit and Viterbicomplex math and CRC unit(VCU)CPU(C28x+FPU+VCU).C28x+FPU+VCU-based controllers have the same32-bit fixed-point architecture as TI's existing C28x MCUs,but also include a single-precision(32-bit)IEEE754floating-point unit(FPU)similar to the FPU on TMS320x2832x/2833x devices.It is avery efficient C/C++engine,enabling you to develop system control software and math algorithms using C/C++.Some2806x devices also include a control law accelerator(CLA)independent of the main CPU;this is the same CLA used by some2803x devices.Finally,2806x devices include the new Viterbicomplex math and CRC unit(VCU),a fully programmable block that accelerates the performance ofcommunications-based algorithms by up to a factor of8X over C28x devices without a VCU.No changes have been made to the existing:•C28x instructions•C28x pipeline•C28x emulation•Memory bus architectureC28x,C2000,Code Composer Studio are trademarks of Texas Instruments.All other trademarks are the property of their respective owners.2TMS320F2802x/TMS320F2803x to TMS320F2806x Migration Overview SPRABJ2–March2011 Development Tools New instructions to support floating point operations have been added as an extension to the standard C28x instruction set.This means code written for the C28x fixed-point CPU is100%compatible with the C28x+FPU.The C28x+FPU latched overflow and underflow(LVF,LUF)flags are connected to theperipheral interrupt expansion(PIE)block.This makes debugging overflow and underflow issues much easier.For an introduction to the C28x+FPU,see the TMS320C28x FPU Primer(SPRAAN9)and theTMS320C28x Digital Signal Controller Plus Floating Point Unit online training that is located at the TIwebsite at /docs/training/catalog/events/event.jhtml?sku=OLT107003.The C28x+FPU+VCU architecture and instruction set are documented in the following reference guides:•TMS320C28x DSP CPU and Instruction Set Reference Guide(SPRU430).This document also applies to the C28x+FPU.•TMS320C28x Floating Point Unit and Instruction Set Reference Guide(SPRUEO2).This is a supplement to SPRU430.•TMS320x2803x Piccolo Control Law Accelerator(CLA)Reference Guide(SPRUGE6)•TMS320x2806x Piccolo Technical Reference Manual(SPRUH18)For more information on the Viterbi complex math and CRC(VCU)unit,see Section9.1.2.3Development ToolsA new set of header files and peripheral examples are available for the2806x with the same structure asthe2802x/2803x header files.The F2806x Header Files and Peripheral Examples are included in thecontrolSUITE zip package(SPRCA85)under the device_support folder.The C28x+FPU+VCU on the2806x is supported with Code Composer Studio™software with CodeGen Tools v6.0or later.Check the Code Composer Studio update advisor for future updates.When building for native floating-point,you must use the correct run-time support library.For example,rts2800_fpu32.lib forC or rts2800_fpu32_eh.lib for C++.These libraries are supplied with the compiler.NOTE:To get the best native floating-point performance on2806x for math routines,consider usingthe C28x FPU Fast RTS Library(SPRC664).The C28x Fast RTS is a collection of optimizedfloating-point math functions for C programmers of the C28x with floating-point unit.Designers of computationally intensive real-time applications can achieve execution speedsconsiderably faster than what are currently available without having to rewrite existing code.The functions listed in the features section are specifically optimized for the C28x+FPUcontrollers.NOTE:To enable the compiler to generate native FPU instructions,you should indicate in CodeComposer Studio that you have a C28x device with a floating-point unit.To do this,use thefollowing compiler switches:-v28--float_support=fpu32In Code Composer Studio,the fpu32switch is under the runtime model compiler options.You cannot mix code built without the--float_support=fpu32switch with code builtwith it.This is because the compiler calling conventions changed for floating-point numbers.If you try to mix the two,the linker issues an error indicating the object files are notcompatible.If you receive this error,check that all libraries have been built with the sameswitch.In particular the runtime support library that comes with the compiler must be correct.When compiling with--float_support=fpu32use the rts2800_fpu32.lib orrts2800_fpu32_eh.lib.Package and Pinout NOTE:To enable the compiler to generate native VCU instructions,you should indicate that youhave a C28x device with a Viterbi,complex math,and CRC unit.To do this,use the followingcompiler switches:-v28--vcu_support=vcu32In Code Composer Studio,the VCU switch is under the runtime model compiler options forCode Composer Studio v4.2.2+.For versions prior to v4.2.2,VCU support can be added viathe C2000™command line pattern by inserting the--vcu_support=vcu0switch afterthe${command}tag and prior to the${flags}tag.3.1Migrating Between IQ_Math and Native Floating-PointThe following steps must be taken to convert a project written in IQmath format to native floating point.1.Select FLOAT_MATH in the IQmath header file.The header file converts all IQmath function calls totheir floating-point equivalent.2.Convert the floating-point number to an integer when writing a floating-point number into a deviceregister.Likewise,when reading a value from a register,it needs to be converted to float.In bothcases,this is done by multiplying the number by a conversion factor.For example,to convert afloating-point number to IQ15,multiply by32768.0as shown below.#if MATH_TYPE==IQ_MATHPwmReg=(int16)_IQtoIQ15(Var1);#else//MATH_TYPE is FLOAT_MATHPwmReg=(int16)(32768.0L*Var1);#endifTo convert from an IQ15value to a floating-point value,multiply by1/32768.0or0.000030518.0.3.Do the following to take advantage of the on-chip floating-point unit:•Use Code Composer Studio with the C28x codegen tools version6.0or later.•Indicate to the compiler that it can generate native C28x floating-point code.To do this,use the –v28--float_support=fpu32compiler switches.In Code Composer Studio,the float_supportswitch is on the Advanced tab of the compiler options.•Use the correct run-time support library for native32-bit floating-point.For C code,this is rts2800_fpu32.lib.For C++code with exception handling,use rts2800_fpu32_eh.lib.•Consider using the C28x FPU Fast RTS Library(SPRC664)to get a performance boost from math functions such as sin,cos,div,sqrt,and atan.The Fast RTS Library should be linked in before thenormal run-time support library.4Package and PinoutThe two device groups are not pin-compatible.Any application being moved from one to the other requiresa new board layout to accommodate the changes in pinout.5Operating FrequencyThe2802x/2803x devices are available as60MHz or40MHz devices.The2806x devices are available as80MHz devices.Both device groups have the same power supply and core voltage requirements.NOTE:Always refer to the TMS data manual for information regarding any electrical specifications.See the following data manuals for the most recent detailed electrical specifications:•TMS320F28027,TMS320F28026,TMS320F28023,TMS320F28022,TMS320F28021, TMS320F28020,TMS320F280200Piccolo Microcontrollers Data Manual(SPRS523)•TMS320F28030,TMS320F28031,TMS320F28032,TMS320F28033,TMS320F28034, TMS320F28035Piccolo Microcontrollers Data Manual(SPRS584)4TMS320F2802x/TMS320F2803x to TMS320F2806x Migration Overview SPRABJ2–March2011 Supply Voltage and Power Sequencing •TMS320F28069,TMS320F28068,TMS320F28067,TMS320F28066,TMS320F28065, TMS320F28064,TMS320F28063,and TMS320F28062DSPs Data Manual(SPRS698)6Supply Voltage and Power SequencingSupply voltage and power sequencing requirements are identical for both device groups.That is,the VDDIO and Vrail can ramp together.DDFor details related to power sequencing,see the device-specific data manual:•TMS320F28069,TMS320F28068,TMS320F28067,TMS320F28066,TMS320F28065, TMS320F28064,TMS320F28063,and TMS320F28062DSPs Data Manual(SPRS698)7Memory MapThe memory maps are similar except for the changes described in this section.7.1Sequential Access Random Access Memory(SARAM)This section highlights the major differences in the SARAM memory subsystem.•Increased amount of SARAMOn the2802x,up to6K x16words of SARAM is available.On the2803x,up to10K x16is available.On the2806x,up to50K x16words of SARAM is available.•Maximum SARAM block size8K x16The maximum size of an SARAM block is now8K x16(L4through L8).•Additional SARAM blocksThe2806x devices have the same size and address SARAM blocks L0through L3.In addition,the2806x family adds five larger SARAM blocks L4through L8.The additional memory blocks make it easier to partition code and data.If your code uses multiply and accumulate operations(MAC),for example,you will want to partition the opcode and two operands into three different memory blocks.This allows for maximum efficiency.•SARAM blocks are not dual-memory mappedMemory block L0is dual mapped into both high memory and low memory on2802x/2803x devices.On the2806x,L0is not mirrored.•DMA accessible SARAMThe L5-L8memory blocks can be used as a source and/or destination for each of the6DMAchannels.DMA accesses to L5-L8are0wait.On the2802x/2803x,DMA was not available.Table1shows SARAM addresses.Table1.SARAM AddressesMemory Address(1)2802x Memory Block2803x Memory Block2806x Memory Block0x008000–0x008FFF L0L0/L1/L2L0/L1/L20x009000–0x009FFF Reserved L3L30x00A000–0x00BFFF Reserved Reserved L40x00C000–0x00DFFF Reserved Reserved L50x00C000–0x00DFFF Reserved Reserved L60x010000–0x011FFF Reserved Reserved L70x012000–0x013FFF Reserved Reserved L80x3F8000–0x3F8FFF L0Mirror L0Mirror/Boot ROM/Vector Boot ROM/Vector(1)Some SARAM blocks may not be available on some family derivatives.For more information,see the device-specific data sheet.Memory Map 7.2Flash and OTPThis section highlights the major differences in the Flash and OTP memory subsystem.7.2.1The size and number of sectors has changed and code must be rebuilt accordingly.The exact Flashsize as well as sector configuration varies from device to device as shown in Table2.Table2.Sector Configuration Per DeviceF28065F28069F28026F28027F28033F28064F28068F28022F28023F28032F28035F28063F28067 F28026F28020F28021F28030F28031F28034F28062F280662Sectors4Sectors4Sectors4Sectors8Sectors8Sectors8Sectors8Sectors4K X164K X168K X164K X164K X168K X168K X1616K X16 Total8K X1616K X1632K X1616K X1632K x1664K x1664K x16128K x167.2.2Flash Access TimeFor a given frequency,the access time of the Flash is the same for the2802x/2803x and2806x.Access times for clock speeds greater than60MHz will be published in the device-specific data manual.NOTE:Always refer to the device-specific data manual timing information.7.2.3Entry Point Into Flash and CSM Password LocationsOn both device groups,the boot ROM entry point and code security module password locations arelocated at the highest addresses of sector A.7.2.4Entry Point Into OTPOn both device groups,the boot ROM entry point into the OTP is the first address within the OTP.7.2.5Flash ProgrammingThe method for programming the device remains the same.TI supplies a Flash application programming interface(API)per device that is used as the basis of all programming solutions.The Flash API andprogramming algorithms for the F2802x/F2803x devices cannot be used on the F2806x.New Flash APIs are required to program these devices;however,the Flash API function prototypes remain compatible.NOTE:The Flash API includes timing critical delay loops.These loops should always be run from0wait-state memory in order to be timing accurate.7.3Boot ROMThe boot ROM loaders are nearly identical on both device groups.This section highlights the differences.Some of the enhancements found on the boot ROM include:•The boot ROM has grown to32Kw•ROM API tables have been added to support the Flash API symbols library.•Floating-point math tables have been added in addition to the IQmath tables.NOTE:The memory locations of the IQmath tables has shifted.Make sure to use the newaddresses in your linker command file as shown in the C2806x C/C++Header Files andPeripheral Examples,which is included in the controlSUITE zip package-extract to the Cdrive-v1.9.1(SPRCA85).6TMS320F2802x/TMS320F2803x to TMS320F2806x Migration Overview SPRABJ2–March2011 Clocks and System Control 7.3.1Boot ROM Memory LocationOn2802x/2803x devices as well as the2806x devices,the boot ROM reserved memory is the first80words starting at0x002.Take care not to allocate code or data to these memory locations untilbootloading is complete.OTP_KEY is located at address0x3D7BFB on2806x devices compared to0x3D7BFE on2803x devices, and OTP_BMODE is located at address0x3D7BFE on2806x devices compared to0x3D7BFF on2803x devices.7.3.2Boot-Mode SelectionThe boot mode selection for2806x devices has some minor differences compared to the2802x/2803x devices.On the2802x/2803x devices,the check value for OTP_KEY is0x55AA,while the check value on2806x devices is instead0x005A.7.3.3BootloadersThe bootloaders for2806x devices operate the same as the bootloaders for the2802x/2803x.7.3.4Boot ROM Math TablesThe2806x has selected IQmath functions programmed into ROM,similar to2802x/2803x devices.To take full advantage of the2806x FPU,the2806x ROM also includes floating-point math tables used by theC28x FPU Fast RTS Library(SPRC664).For more information on the boot ROM,see the following reference guides:•TMS320x2802x Piccolo Boot ROM Reference Guide(SPRUFN6)•TMS320x2803x Piccolo Boot ROM Reference Guide(SPRUGO0)•TMS320x2806x Piccolo Technical Reference Manual(SPRUH18)8Clocks and System ControlThis section describes changes that affect device clocking and system control.This includes new andrenamed registers,pin functionality,new logic,and other enhancements.For more information on system control,see the following reference guides:•TMS320F2803x Piccolo System Control and Interrupts Reference Guide(SPRUGL8)•TMS320F2802x/TMS320F2802xx Piccolo System Control and Interrupts Reference Guide(SPRUFN3)•TMS320x2806x Piccolo Technical Reference Manual(SPRUH18)8.1Register ChangesTable3shows a summary of registers that were added,renamed,or modified.The following sectionsdescribe changes that were made.This section does not include the new DMA registers as they can be considered as all new.Table3.New,Updated,and Removed RegistersRegister Change DescriptionAdded support for additional SCI and McBSP clock enables and removed LIN clock PCLKCR0UpdatedenablePCLKCR1Updated Added support for additional ePWM,eCAP,and eQEP clock enablesPCLKCR2New Support for HRCAP clock enablesPCLKCR3Updated Added support for USB and DMA clock enablesPLLCR Updated Added bit adds support for more PLL clocking ratio settingsPLL2CTL New PLL2Configuration RegisterPLL2MULT New PLL2Multiplier RegisterPLL2STS New PLL2Lock Status RegisterPeripherals Table3.New,Updated,and Removed Registers(continued)Register Change DescriptionSYSCLK2CNTR New SYSCLK2Clock Counter RegisterEPWMCFG New ePWM DMA/CLA Configuration Register8.2PLL MultiplierOn2802x/2803x,the PLL multiplier can be set anywhere from0to12–this multiplier is controlled by the last4bits(DIV)of the PLL Control Register(PLLCR).On the2806x,the PLL multiplier can be setanywhere from0to16–this multiplier is controlled by the last5bits(DIV)of the PLL Control Register (PLLCR).Along with the PLL divider controlled by bits(DIVSEL)in the PLL Status Register(PLLSTS),the PLL multiplier sets the PLL clocking ratio.8.3Peripheral Clock Enable RegistersDue to new peripherals and additional instances of old peripherals,the registers to enable and disable the clocks to individual peripherals have been updated(PCLKCR0,PCLKCR1,and PCLKCR3).There is an additional register to enable and disable the clocks to the HRCAP:Peripheral Clock Control Register2 (PCLKCR2).8.4SYSCLK2ControlOn2806x,an additional System Clock(SYSCLK2)has been added as a clock source to support theHRCAP and new USB modules.An additional PLL(PLL2)is used for SYSCLK2.Several registers have been added to configure this new clock.The PLL2Configuration Register(PLL2CTL)enables and disables PLL2and selects the clock source–by default,X1is selected.The last4bits(PLL2MULT)of the PLL2Multiplier Register(PLL2MULT)allowPLL2to be set to any multiplier value from0to15–this is similar to the functionality of PLLCR in relation to the PLL.A read-only status bit(PLL2LOCKS)is also provided in the PLL2Lock Status Register(PLL2STS)to determine whether the PLL2has locked.SYSCLK2also has a free running counter that can be read by software to help determine the approximate frequency SYSCLK2is running.This counter can be read from the COUNT field in the SYSCLK2Clock Counter Register(SYSCLK2CNTR).8.5Enhanced Pulse Width Modulator(ePWM)DMA/CLA ConfigurationTo support the addition of the DMA module on the2806x,a new ePWM DMA/CLA Configuration Register (EPWMCFG)has been added.Bit0(CONFIG)of this register controls whether ePWM blocks areconnected to the DMA bus or to the CLA bus.9PeripheralsNew peripherals have been added and others have been updated.This section briefly describes thechanges.For an overview of all peripherals available,see the TMS320x28xx,28xxx DSP PeripheralReference Guide(SPRU566).9.1New PeripheralsThe2806x devices include new peripherals that are not available on the2802x/2803x devices.9.1.1Direct Memory Access(DMA)The direct memory access module provides a hardware method of transferring data between peripherals and/or memory without intervention from the CPU,thereby,freeing up bandwidth for other systemfunctions.Additionally,the DMA has the capability to orthogonally rearrange the data as it is transferred as well as ping-pong data between buffers.These features are useful for structuring data into blocks foroptimal CPU processing.8TMS320F2802x/TMS320F2803x to TMS320F2806x Migration Overview SPRABJ2–March2011 Peripherals The DMA module is an event-based machine requiring a peripheral interrupt trigger to start a transfer.The interrupt trigger source for each of the six DMA channels can be configured separately and each channel contains its own independent PIE interrupt to let the CPU know when a DMA transfers has either started or completed.Major features of the DMA are:•Six channels.Each channel has its own interrupt in the PIE vector table.•Trigger sources include:–Analog-to-digital converter(ADC)interrupts1and2–McBSP transmit and receive–External interrupts1-3–CPU timers–ePWM1-6start of conversion(SOCA,SOCB)–USB endpoints transmit and receive–Software•Data sources and destinations:L5-L8SARAM,ADC result registers,McBSP transmit and receive registers,ePWM registers.•Word size can be configured for x16or x32bits.For more information,see the TMS320x2806x Piccolo Technical Reference Manual(SPRUH18).9.1.2Viterbi,Complex Math,and CRC Unit(VCU)The C28x+VCU enhances the processing power of C2000devices by adding additional assemblyinstructions to target complex math,Viterbi decode,and CRC calculations.The VCU instructionsaccelerate many applications,including the following:•Orthogonal frequency-division multiplex(OFDM)used in the PRIME and G3standards for power line communications•Short-range radar complex math calculations•Power calculations•Memory and data communication packet checks(CRC)Major VCU features include:•Instructions to support cyclic redundancy checks(CRCs),which is a polynomial code checksum.•Instructions to support a flexible software implementation of a Viterbi decoder•Complex math arithmetic unit•Independent register spaceFor more information,see the TMS320x2806x Piccolo Technical Reference Manual(SPRUH18).9.1.3Multichannel Buffered Serial Port(McBSP)The McBSP is highly configurable and supports a variety of application interfaces.The McBSP on the2806x is similar to that on the TMS320x2832x/2833x devices.For more information,see:•TMS320F28069,TMS320F28068,TMS320F28067,TMS320F28066,TMS320F28065, TMS320F28064,TMS320F28063,and TMS320F28062DSPs Data Manual(SPRS698)•TMS320x2806x Piccolo Technical Reference Manual(SPRUH18)9.1.4Universal Serial Bus(USB)The2806xU parts include a USB2.0compliant USB controller and PHY.The USB peripheral supports full-speed operation as a device and both low and full speed in host operating modes,but does notsupport high speed or on-the-go(OTG)operations.TI provides drivers for the USB controller as well as a protocol stack free of charge in our controlSuite software package.Both the USB controller and itscorresponding software package are very similar to that of the Stellaris family of microcontrollers,somigration of USB applications between the two platforms requires minimal effort.Peripherals For more information,see:•TMS320x2806x Piccolo Technical Reference Manual(SPRUH18)•TMS320F2806xU USB Software Guide,which is included in the controlSUITE zip package-extract to the C drive(SPRCA85)9.2Control Law Accelerator(CLA)The2806x CLA is similar to the CLA in2803x devices.The CLA register sets are identical on the twodevice groups:the memory addresses of the CLA control registers and the CLA message RAM are also identical.Some enhancements of the2806x CLA include:•The2806x CLA can operate at up to80MHz(2803x CLA can operate up to60MHz).•L0RAM is connected to the CLA as CLA data RAM2for the2806x.L1,L2,and L3RAM are connected to the CLA as CLA data RAM0,CLA data RAM1,and CLA program RAM as in2803xdevices.–The CLA Memory and Clock Configuration Register(MMEMCFG)has been updated with an additional bit to enable access for the CLA data RAM2.–Additional bits have been added to the MMEMCFG register to allow CPU write access(in addition to read)to each CLA data RAM.•The2806x CLA core is DMA accessible.•In addition to the ADC result registers,comparator registers,and the ePWM+HRPWM registers accessible by the2803x CLA,the2806x CLA has direct access to the eCAP and eQEP registers.–The2806x CLA Peripheral Interrupt Source Select Register(MPISRCSEL1)bit definitions have been updated correspondingly to include interrupt sources from the eCAP and eQEP modules.9.3High-Resolution Capture(HRCAP)The2806x HRCAP module captures the width of pulses with a typical resolution of hundreds ofpicoseconds and performs both conventional and high-resolution delta time measurements.Uses for the HRCAP include:•Capactive touch applications•High-resolution period and duty cycle measurements of pulse train cycles•Instantaneous speed measurements•Instantaneous frequency measurements•Reading the feedback across an isolation boundary•Distance/sonar measurement and scanning9.4Enhanced Control PeripheralsThe eCAP,ePWM,HRPWM,and eQEP modules remain functionally the same.The register sets areidentical on the two device groups:the memory addresses of the registers for each instance of peripheral are also identical.For example,ePWM1registers on2802x/2803x are at the same location as ePWM1 registers on2806x.In addition,the interrupt vector location in the PIE vector table is identical.Newinterrupt vectors have been added to the PIE vector table for the additional peripheral instances(i.e.,eCAP3,eQEP2,etc.).In addition,the modules have these added features:•2806x devices have three eCAP modules(one more than2802x/2803x devices)•2806x devices have two eQEP modules(one more than2802x/2803x devices)•2806x devices have up to8ePWM modules and8HRPWM-capable channels(one more than 2802x/2803x devices)•2806x devices have4HRCAP modules(as discussed in Section9.3)•On2806x devices,the eCAP and eQEP modules are CLA accessible.•On2806x devices,the ePWM and HRPWM modules are DMA accessible.10TMS320F2802x/TMS320F2803x to TMS320F2806x Migration Overview SPRABJ2–March2011。

tms320f28数字信号控制器入门

tms320f28数字信号控制器入门
图片列表
1 Spectrum Digital 公司的 C2000 开发工具网站 .......................................................................... 6 2 eZdspF2808 上的启动至 SARAM 开关 1 配置。 ....................................................................... 6 3 Code Composer Studio 文件视图 (File View) 窗口 ..................................................................... 7 4 280x CPU 定时器示例监视窗口 ........................................................................................... 8 5 添加变量到 Watch Window ................................................................................................ 8 6 调试菜单 (Debug Menu) 中实时模式选项 (Real-time Mode Option) ................................................. 9
2833x • 2833x 器件列表含有到每个器件文件夹的连接 • 《TMS320F28335,TMS320F28334,TMS320F28332 数字信号控制器 (DSC) 数据手册》(文献

基于TMS320F2812的最小系统设计

基于TMS320F2812的最小系统设计
DSP 最 小 系 统 平 台 的 构 建 采 用 模 块 化 设 计 , 其 系 统 框图如图 1 所示。
* 基 金 项 目 : 四 川 省 成 都 市 西 华 大 学 重 点 学 科 研 究 项 目 ( SZD0409 )
《微型机与应用》 2010 年第 12 期
JTAG 电 路 外
电源

DSP
《微型机与应用》 2010 年第 12 期
图形、图像与多媒体 Image Processing and Multimedia Technology
址 线 , 所 以 最 大 可 以 达 到 512 KB , 片 选 信 号 用 CS2 。 具 体 连接如图 6 所示。
1.5.2 SCI 串 口 通 信 电 路 在 许 多 DSP 的 应 用 中 都 会 使 用 到 串 行 口 与 电 脑 的

复位电路

Hale Waihona Puke 电路 时钟电路图 1 最小系统结构框图
1.1 电源电路 一个稳定可靠的电源是系统稳定工作的基础。 考虑
到 DSP 的 内 核 工 作 电 压 为 1.8 V, 其 I/O 的 工 作 电 压 为 3.3 V,再 者 一 般 的 外 围 器 件 工 作 电 压 为 5 V,所 以 需 要 提供这三种工作电压。 首先, 通过外部电源适配器获 得+5 V 电压,考虑到电源工作的稳定性和可靠性 ,采用 市 场 上 现 成 的 电 源 适 配 器 ; 然 后 再 通 过 LDO ( 低 压 差 线 性稳压电源)将 5 V 电压转换成 3.3 V 和 1.8 V,采用的是 Sipex 公 司 的 SPX1117 系 列 LDO 芯 片 [3] 来 进 行 电 压 的 转 换 。 该 系 列 LDO 芯 片 输 出 电 压 的 精 度 在 ±1% 以 内 , 具 有 电流限制和热保护功能,价格低廉,广泛应用于手持仪 表、数字家电和工业控制领域。使用时,输出端常接一个 10 μF 或 者 47 μF 的 电 容 来 改 善 瞬 态 响 应 和 稳 定 性 。 具 体的连接如图 2 所示。

第4章_TMS320F2812系统控制及中断PPT课件

第4章_TMS320F2812系统控制及中断PPT课件

批示一样, 任意一级领导的不同意,都不能被送至上一级领导,
更不可能得到最终的批准,中断机制的原理也是如此。
华东交通大学电精选气学院
16
外设中断请求流程
华东交通大学电精选气学院
17
(1).外设级中断
▪ 假如在程序的执行过程中,某一个外设产生了一个中
断事件,那么在这个外设的某个寄存器中与该中断事 件相关的中断标志位(IF=Interrupt Flag)被置为 1。 此时,如果该中断相应的中断使能位(IE=Interrupt Flag)已经被置位,也就是为 1,外设就会向 PIE 控 制器发出一个中断请求。相反的,如果虽然中断事件
▪ 时钟频率具体的计算如下面所示。 晶振为 30M,
PLLCR 的 DIV 位被设置成 1010 时的时钟频率
CLKIN=(OSCLKIN*10)/2=(XCLKIN*10)/2=(30M*10)/2=150M Hz
华东交通大学电精选气学院
7
外设时钟的使能
▪ 我们在使用 2812 开发的时候,通常会用到一些外设,
每个组有 8 个中断,而且每个组都被反馈到 CPU 内核的 12 条中断线中的某一条上(INT1-INT12),我们平时用到的 所有的外设中断都被归入了这 96 个中断中,被分布在不同 的组里,使用多路复用的原理。PIE 目前只使用 了 96 个中 断中的 45 个,其他的等待将来的功能扩展。
华东交通大学电精选气学院
▪ 清除 PIE 中与 T1PINT 相关的应答位的语句
➢ PieCtrl.PIEACK.bit.ACK2=1;
华东交通大学电精选气学院
20
PIE中断需注意的问题
▪ 将 PIE 级的中断和外设级的中断相比较之后发现,外

TMS320F2802或2808的DSP开发板原理图(密)

TMS320F2802或2808的DSP开发板原理图(密)
U7 74LVXC3245 SISSO24
24 23 22 21 20 19 18 17 16 15 14 13
+5V FO_IN U_IN V_IN W_IN A_IN B_IN Z_IN
SR0805 SR0805 SR0805 SR0805 SR0805 SR0805 SR0805 SR0805
Байду номын сангаас
56 58 60 61 64 70 1 95 8 9 50 52 54 57 63 67 71 72 83 91 99 79 92 4 6 7 100 5 43
R49 SR08052K
R50 SR08052K
R51 SR08052K
R52 SR08052K
R53 SR08052K
1
SR0805
SR0805
OUTA OUTB OUTC OUTD
3 13 5 11
A_IN B_IN Z_IN U_IN_75175
3
2
JP3 JUMPER3Pin JUMPER3P
A/CCTRL B/DCTRL VCC GND 8
14 25 13 39
VSSA2 VSSAIO VSS1AGND VSS2AGND TRST EMU0 EMU1 TMS TCK TDI TDO XRS XCLKOUT XCLKIN X2 X1 TEST1 TEST2
PWM1A PWM1B PWM2A PWM2B PWM3A PWM3B
SR0805 SR0805 SR0805 SR0805 SR0805 SR0805
3 2
20MHz/3.3V
R64 62 SR0805
1
C52 100pF SC0805
GPIO6 ECAP2/GPIO7 ADCSOCAO/GPIO8 GPIO9 ADCSOCBO/GPIO10 GPIO11 TZ1/SPISIMOB/GPIO12 TZ2/SPISOMIB/GPIO13 TZ3/SPICLKB/GPIO14 TZ4/SPISTEB/GPIO15 TZ5/SPISIMOA/GPIO16 TZ6/SPISOMIA/GPIO17 SPICLKA/GPIO18 SPISTEA/GPIO19 QEP1/GPIO20 QEP2/GPIO21 EQPE1S/GPIO22 EQPE1I/GPIO23 ECAP1/SPISIMOB/GPIO24 ECAP2/SPISOMIB/GPIO25 SPICLKB/GPIO26 SPISTEB/GPIO27 TZ5/SCIRXDA/GPIO28 TZ6/SCITXDA/GPIO29 CANRXA/GPIO30 CANTXA/GPIO31 SDA/GPIO32 SCL/GPIO33 GPIO34
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档