欢迎来到天天文库
浏览记录
ID:41377164
大小:9.40 MB
页数:181页
时间:2019-08-23
《《DSP芯片应用》PPT课件》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第8章DSP芯片应用8.1引言8.2DSP芯片C语言开发简介8.3模/数接口设计8.4存储器接口设计8.5G.726语音编解码系统8.6语音实时变速系统8.1引言前面几章我们介绍了DSP芯片的原理以及CCS开发工具。TMS320C5409是目前性能价格比较高的一种定点DSP芯片,已经在很多领域得到了广泛的应用。本章以TMS320C5409为例,介绍DSP应用系统的设计、调试和开发过程。8.2DSP芯片C语言开发简介8.2.1TMS320C54xC/C++编译器支持的数据类型表8-1列出了TMS320C54xC/C++编译器支持的数据类型的大小、表示形式和表示范围,这些数据类型在flo
2、at.h和limits.h中定义。在C语言开发的过程中,采用合适的数据类型对于系统的正确运行有着极为重要的意义。表8-1TMS320C54xC/C++编译器支持的数据类型类型大小/bit表示形式最小值最大值signedchar16ASCII−3276832767char,unsignedchar16ASCII065535short,signedshort162sComplement−3276832767unsignedshort16Binary065535int,signedint162sComplement−3276832767类型大小/bit表示形式最小值最大值unsignedi
3、nt16Binary065535long,signedlong322sComplement−21474836482147483647unsignedlong32Binary04294967295enum162sComplement−3276832767float32IEEE32-bit1.175494e−383.40282346e+38double32IEEE32-bit1.175494e−383.40282346e+38longdouble32IEEE32-bit1.175494e−383.40282346e+38pointers16Binary00xFFFF8.2.2C语言的数据
4、访问方法1.DSP片内寄存器的访问DSP片内寄存器在C语言中一般采用指针方式来访问,常常采用的方法是将DSP寄存器地址的列表定义在头文件中(如reg.h)。DSP寄存器地址定义的形式为宏,如下所示:#defineIMR(volatileunsignedint*)0x0000#defineIFR(volatileunsignedint*)0x0001#defineST0(volatileunsignedint*)0x0006#defineST1(volatileunsignedint*)0x0007#defineAL(volatileunsignedint*)0x0008#define
5、AH(volatileunsignedint*)0x0009#defineAG(volatileunsignedint*)0x000A#defineBL(volatileunsignedint*)0x000B#defineBH(volatileunsignedint*)0x000C#defineBG(volatileunsignedint*)0x000D#defineT(volatileunsignedint*)0x000E#defineTRN(volatileunsignedint*)0x000F#defineAR0(volatileunsignedint*)0x0010#defi
6、neAR1(volatileunsignedint*)0x0011#defineAR2(volatileunsignedint*)0x0012#defineSP(volatileunsignedint*)0x0018#defineBK(volatileunsignedint*)0x0019#defineBRC(volatileunsignedint*)0x001A#defineRSA(volatileunsignedint*)0x001B#defineREA(volatileunsignedint*)0x001C#definePMST(volatileunsignedint*)0x0
7、01D#defineXPC(volatileunsignedint*)0x001E在主程序中,若要读出或者写入一个特定的寄存器,就要对相应的指针进行操作。下例通过指针操作对SWWSR和BSCR进行初始化。#defineSWWSR(volatileunsignedint*)0x0028#defineBSCR(volatileunsignedint*)0x0029intfunc(){...*SWWSR=0x2000;*BSCR=0x0000;...}2.DSP
此文档下载收益归作者所有