I will try to use the Timer Interrupt. I made sure that the Timer is running and interrupt occur.
Register bit PRDINTSTAT34;12 in INTCTLSTAT is 1; Interrupt has occurred.
I saw the following methods to try.
- Use Timer0 32bit unchain mode.
- PRD = 0x50000
- TMR0_INTCTLSTAT |= 0x00010001; // enable timer0 12, 34 interrupt
- INTMUX1 = 0x00400400; // use INTSEL5, INTSEL6
and intvct.asm file add to project
intvect.asm as follows.
; Global symbols defined here and exported out of this file
.global _intcVectorTable
.global _c_int00
.global _TIMER0_TINT12_isr
.global _TIMER0_TINT34_isr
.global _vector3
.global _vector4
.global _vector5
.global _TIMER1_TINT12_isr
.global _TIMER1_TINT34_isr
.global _vector8
.global _vector9
.global _vector10
.global _vector11
; 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).
.sect ".vecs"
.align 1024
_intcVectorTable:
_vector0: VEC_ENTRY _vec_dummy ;RESET
_vector1: VEC_ENTRY _TIMER0_TINT12_isr ;NMI
_vector2: VEC_ENTRY _TIMER0_TINT34_isr ;RSVD
_vector3: VEC_ENTRY _vec_dummy ;RSVD
_vector4: VEC_ENTRY _vec_dummy ;isr0
_vector5: VEC_ENTRY _vec_dummy ;isr1
_vector6: VEC_ENTRY _vec_dummy ;isr2
_vector7: VEC_ENTRY _vec_dummy ;isr3
_vector8: VEC_ENTRY _vec_dummy
_vector9: VEC_ENTRY _vec_dummy
_vector10: VEC_ENTRY _vec_dummy
_vector11: VEC_ENTRY _vec_dummy
Also ISR was used as follows.
void TIMER0_TINT12_isr(void)
{
Tmr_test1++;
}
void TIMER0_TINT34_isr(void)
{
Tmr_test2++;
}
But Tmr_test1,2 is not increase.
How to use Interrupt service routine?
Someone cna help me!
Thanks.