关于f2812中用c语言来实现中断的说明

上传人:自*** 文档编号:79777083 上传时间:2019-02-18 格式:DOCX 页数:2 大小:45.12KB
返回 下载 相关 举报
关于f2812中用c语言来实现中断的说明_第1页
第1页 / 共2页
关于f2812中用c语言来实现中断的说明_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《关于f2812中用c语言来实现中断的说明》由会员分享,可在线阅读,更多相关《关于f2812中用c语言来实现中断的说明(2页珍藏版)》请在金锄头文库上搜索。

1、关于F2812中用C语言来实现中断的说明(不带DSP/BIOS)(一) 关于F2812中用C语言来实现中断的说明: 1.首先在.cmd中定位系统中断表: MEMORY PAGE 0 : . PAGE 1 : . PIE_VECT : origin = 0x000D00, length = 0x000100 . SECTIONS . PieVectTable : PIE_VECT, PAGE = 1 . 2.在C中制定该中断的结构体: #pragma DATA_SECTION(PieVectTable,PieVectTable); struct PIE_VECT_TABLE PieVectTab

2、le;(在DSP28_GlobalVariableDefs.C中初始化)3.在DSP281x_PieVect.h中定义中断向量表PIE_VECT_TABLE,共96个成员,每个成员均为void(*PINT)(void),中断指针型。/ PIE Interrupt Vector Table Definition:/ Create a user type called PINT (pointer to interrupt):typedef interrupt void(*PINT)(void);/ Define Vector Table:struct PIE_VECT_TABLE / Reset

3、is never fetched from this table. It will always be fetched from 0x3FFFC0 in /either boot ROM or XINTF Zone 7 depending on the state of the XMP/MC input /signal. On the F2810 it is always fetched from boot ROM.。(略)。/ Non-Peripheral Interrupts:。(略)。/ Group 12 PIE Peripheral Vectors:。(略)。;然后定义外部PIE_VE

4、CT_TABLE结构体变量PieVectTable:extern struct PIE_VECT_TABLE PieVectTable;(在.h文件中)4.在DSP281x_PieVect.c文件中初始化该表使之能够为主程序所使用:(1)先定义一个PIE_VECT_TABLE结构体常量:const struct PIE_VECT_TABLE PieVectTableInit = 。(略)。PIE_RESERVED。(略)。注此处用到的所有中断向量或者说是中断函数的指针均是在DSP281x_DefaultIsr.c中定义的空函数(指针);(2)用以上PIE_VECT_TABLE结构体常量PieV

5、ectTableInit 初始化PIE_VECT_TABLE结构体变量PieVectTable/ InitPieVectTable:/ This function initializes the PIE vector table to a known state./ This function must be executed after boot time.void InitPieVectTable(void)int16 i;Uint32 *Source = (void *) &PieVectTableInit;Uint32 *Dest = (void *) &PieVectTable;EA

6、LLOW;for(i=0; i 128; i+)*Dest+ = *Source+;EDIS;/ Enable the PIE Vector TablePieCtrl.PIECRTL.bit.ENPIE = 1;5.自己的中断服务程序:用自己定义的中断函数覆盖PIE_VECT_TABLE结构体变量PieVectTable中对应的中断指针即可。PieVectTable.TINT2 = &ISRTimer2;那么,ISRTimer2也就成了中断服务程序,要在主程序的开始先声明该程序:interrupt void ISRTimer2(void);然后按照您的需要编制该程序:interrupt void ISRTimer2(void)CpuTimer2.InterruptCount+;

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号