你好,我采用的是C6747芯片,有以下几个问题请教。
1、跳进中断后,第一次执行清除中断标志位的语句起不了作用,中断标志位不能及时清除,程序在执行完中断服务程序后,会再次跳进中断,再次执行清除中断标志的语句,才会把中断标志位清除,请问这可能是哪里的问题,我实在想不明白。
2、请问有没有用定时器实现定时功能的例程啊?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好,我采用的是C6747芯片,有以下几个问题请教。
1、跳进中断后,第一次执行清除中断标志位的语句起不了作用,中断标志位不能及时清除,程序在执行完中断服务程序后,会再次跳进中断,再次执行清除中断标志的语句,才会把中断标志位清除,请问这可能是哪里的问题,我实在想不明白。
2、请问有没有用定时器实现定时功能的例程啊?
1.进入中断后,会自动保存GIE,并清除为0,跳出中断时,恢复GIE值,不需要人工清除。
2. 看一下rcsl里的例程quickStartOMAPL1x_rCSL\OMAPL1x\rCSL_examples\evmOMAPL137\DSP_examples\timer\TIMER_led_blink_frequency_dspL137。
http://processors.wiki.ti.com/index.php/QuickStartOMAPL1x_rCSL
2. 看一下rcsl里的例程quickStartOMAPL1x_rCSL\OMAPL1x\rCSL_examples\evmOMAPL137\DSP_examples\timer\TIMER_led_blink_frequency_dspL137。
http://processors.wiki.ti.com/index.php/QuickStartOMAPL1x_rCSL,这个用定时器实现定时功能的例程在哪里?找不到啊
在上面的链接里下载安装Version 2.0: quickStartOMAPL1x_rCSL_2.0。
中断初始化部分:
void interrupt_Init(void)
{
GPIO_BINTEN=0x02; // 使能GPIO BANK 1外部中断
GPIO_01->SET_FAL_TRIG[1] = 0x001f;
GPIO_01->CLR_RIS_TRIG[1] = 0x001f;
GPIO_01->INTSTAT[1] = 0xffff; // 清除GPIO BANK 1中断标志位
ISTP=0x80000000; // 重置中断向量表到0C00h
asm(" NOP 2 ");
CSR = 0xfffe; // 关全局中断
asm(" NOP 2 ");
ICR = 0xffff; // 清除中断标志位
asm(" NOP 2 ");
IER = 0xffff; // 使能CPU中断
asm(" NOP 2 ");
DSP_INTC->INTMUX1=0x00292804;
asm(" NOP 2 ");
}
中断服务函数:
void interrupt accept ( )
{
SWITCH ( );
GPIO_01->INTSTAT[1]=0xffff; //清除中断标志位
channel = ( Uint16 ) SWITCH( );
Offer ( channel, Rec, 70 );
}
#2. GIE在主函数里用下面的语句实现
CSR=0xffff;
asm(" NOP 2");
#3. 测试时,GPIO不是手动触发,是别的芯片提供中断信号
#4. 中断向量表
.global _intcVectorTable
.global _c_int00
.global _timer0
.global _accept
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00
*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm
*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy:
B B3
NOP 5
*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vectors"
.align 1024
_intcVectorTable:
_vector0: VEC_ENTRY _c_int00 ;RESET
_vector1: VEC_ENTRY _vec_dummy ;NMI
_vector2: VEC_ENTRY _vec_dummy ;RSVD
_vector3: VEC_ENTRY _vec_dummy
_vector4: VEC_ENTRY _vec_dummy
_vector5: VEC_ENTRY _timer0
_vector6: VEC_ENTRY _accept
_vector7: VEC_ENTRY _vec_dummy
_vector8: VEC_ENTRY _vec_dummy
_vector9: VEC_ENTRY _vec_dummy
_vector10: VEC_ENTRY _vec_dummy
_vector11: VEC_ENTRY _vec_dummy
_vector12: VEC_ENTRY _vec_dummy
_vector13: VEC_ENTRY _vec_dummy
_vector14: VEC_ENTRY _vec_dummy
_vector15: VEC_ENTRY _vec_dummy