欢迎来到天天文库
浏览记录
ID:27555691
大小:107.24 KB
页数:4页
时间:2018-12-04
《dm642外部中断的实现总结》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、DM642外部中断的实现总结一)在含有操作系统DSP/BIOS的程序中实现外部中断比较简单,只需要进行如下操作:(1)在源程序文件中,假设为main.c,在其中添加一个中断处理函数,若要使用外部中断4,可添加函数,这里不需要在前面加入interrupt关键字voidint_isp4(){//添加中断处理代码}(2)打开DSP/BIOS配置文件xxx.cdb,选择“Scheduling”卜的“HWI-HardwareInterruptServiceRoutineManager”项,即HWI模块,它管理着DSP/BIOS屮
2、的硬件屮断昀量表,提供基木的屮断控制函数(如图1所示),列出了DM642的所有屮断向量表,其中HWIJNT4,HWI_INT5,HWIJNT6,HWIJNT7是外部中断,这里选择HWIJNT4,在其选项上点击右键,选择”Properties”,弹出如图2所示:EstimatedDalaSize:2785Est.Min.StackSize(MAUs):752+System+ijgInstrumentation彐Scheduling+Cf;-CLK"ClockManager•PRD•PeriodicFunctionMana
3、gerHWI-HardwareInterruptServiceRoutineManagerj白%HWI.RESETM,LHWItffill,一HWI^RESERVEDO
4、rtLHWIRESERVED1,一吒HWIIHT4n,l.KH.IHT5
5、HLHWIINT6,一'HWI.IHT7
6、dLHWIIHT8X——M,LHWIIHT9,一吒HWI.IHT10'HWI^IHTllHWI—IHT12nlJ,HWIIHT13图1,,ILmiIHT14,一llllioutTrxm*7、屮断处理函数,如第一步所定义的int_isp4,注意在这里记得在其函数名前面加上下划线。由此即可完成对外部中断的配置。(二)在非DSP/BIOS巾使川CSLAPI进行设置相对來说比较复杂一些,主要进行如下操作:(1)定义描述DM642中断的向量表文件,这里使用TI公司提供的一个中断向量表文件模板:ves_dm642.asm,内容如下:*Copyright(C)2003TexasInstrumentsIncorporated*AllRightsReserved*vecs_edmal.asm*Assemblyfiletos8、etupinterruptservicetable(1ST)**Globalsymbolsdefinedhereandexportedoutofthisfile*.global.vectors.global_c_int00.global_vectorl.global_vector2.global_vector3.global_int_isp4.global_vector5.global_vector6.global_vector7.global_vector8.global_vector9.global_vectorl9、0.global_vectorll.global_vectorl2.global_vectorl3.global_vectorl4.global.vector15**Globalsymbolsreferencedinthisfilebutdefinedsomewhereelse.*Rememberthatyourinterruptserviceroutinesneedtobereferencedhere.*.ref_c_int00**Thisisamacrothatinstantiatesoneentryinthein10、terruptservicetable.VEC_ENTRY.macroaddrSTWB0,*-B15MVKLaddr,BOMVKHaddr,BOBBOLDW*B15++,B0NOP2NOPNOP•endm**Thisisadummyinterruptserviceroutineusedtoinitializethe1ST.*_vec_dummy:BB3NOP5**Thisistheactualinterruptservicetable(1ST).Itisproperlyalignedand*islocatedinthe11、subsection.text:vecs.Thismeansifyoudon’texplicitly*specifythissectioninyourlinkercommandfile,itwilldefaultandlink*intothe.textsection.RemembertosettheISTPregistertopo
7、屮断处理函数,如第一步所定义的int_isp4,注意在这里记得在其函数名前面加上下划线。由此即可完成对外部中断的配置。(二)在非DSP/BIOS巾使川CSLAPI进行设置相对來说比较复杂一些,主要进行如下操作:(1)定义描述DM642中断的向量表文件,这里使用TI公司提供的一个中断向量表文件模板:ves_dm642.asm,内容如下:*Copyright(C)2003TexasInstrumentsIncorporated*AllRightsReserved*vecs_edmal.asm*Assemblyfiletos
8、etupinterruptservicetable(1ST)**Globalsymbolsdefinedhereandexportedoutofthisfile*.global.vectors.global_c_int00.global_vectorl.global_vector2.global_vector3.global_int_isp4.global_vector5.global_vector6.global_vector7.global_vector8.global_vector9.global_vectorl
9、0.global_vectorll.global_vectorl2.global_vectorl3.global_vectorl4.global.vector15**Globalsymbolsreferencedinthisfilebutdefinedsomewhereelse.*Rememberthatyourinterruptserviceroutinesneedtobereferencedhere.*.ref_c_int00**Thisisamacrothatinstantiatesoneentryinthein
10、terruptservicetable.VEC_ENTRY.macroaddrSTWB0,*-B15MVKLaddr,BOMVKHaddr,BOBBOLDW*B15++,B0NOP2NOPNOP•endm**Thisisadummyinterruptserviceroutineusedtoinitializethe1ST.*_vec_dummy:BB3NOP5**Thisistheactualinterruptservicetable(1ST).Itisproperlyalignedand*islocatedinthe
11、subsection.text:vecs.Thismeansifyoudon’texplicitly*specifythissectioninyourlinkercommandfile,itwilldefaultandlink*intothe.textsection.RemembertosettheISTPregistertopo
此文档下载收益归作者所有