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.

C5515 Interrupts

Other Parts Discussed in Thread: TMS320C5515

Hi,

i have TMS320C5515 ezdsp usb stick board.

As per the Timer Application note it is mention IER0 register should be set.but i am unable to find what is the address of IER0 IO register(from example downloaded from TI website tells that it is 0x0000).

i tried to use timer0 and i want to capture timer interrupt.  But i am not getting it.

here my code :-

#define    CPU_CLOCK    100000000
#define    PRE_SCALER    1024
#define    TIMER_CLOCK    (CPU_CLOCK / PRE_SCALER)
#define    INTERRUPT_TIME_INTERVAL    1000        /* Time in Micro Seconds */
#define    TIMER_PERIOD    TIMER_CLOCK / INTERRUPT_TIME_INTERVAL

#define PSRCR       *(volatile ioport Uint16*)(0x0C04)
#define PRCR       *(volatile ioport Uint16*)(0x0C05)
#define PCGCR       *(volatile ioport Uint16*)(0x1C02)    /* Bit 10: Timer 0 Clock Enable_L */

/* Timer Registers */

#define TCR           *(volatile ioport Uint16*)(0x1810)    /* TCR Timer 0 Control Register */
                                                        /* Bit 15=ENABLE, Bits 5:2= Prescaler 2**1-2**13, 1:Autoreload, 0:Start */
#define TIMPRD1       *(volatile ioport Uint16*)(0x1812)    /* Timer 0 Period Register 1 LSW */
#define TIMPRD2     *(volatile ioport Uint16*)(0x1813)      /* Timer 0 Period Register 2 MSW */
#define TIMCNT1     *(volatile ioport Uint16*)(0x1814)      /* Timer 0 Counter Register 1 LSW */
#define TIMCNT2     *(volatile ioport Uint16*)(0x1815)      /* Timer 0 Counter Register 2 PSW */
#define TIAFR         *(volatile ioport Uint16*)(0x1C14)      /* Timer Interrupt Flag Register Bit 0: Timer0 Flag*/
#define IER0        *(volatile ioport Uint16*)(0x0000)      /* Interrupt Enable Register Bit 4: Timer Interrupt Mask */
#define IFR0        *(volatile ioport Uint16*)(0x0001)      /* Interrupt Flag Register Bit 4: Timer Flag*/
#define RESET_ALL_TIMER_FLAGS    0x07

void Timer0_start(void)
{
USBSTK5515_LED_init( );
USBSTK5515_LED_on( 0 );
PCGCR = 0x0000 ;                    /* Bit 10: Timer 0 Clock Enable_L */

/* Timer Registers */
TIMPRD2 = TIMER_PERIOD >> 16 ;        /* Timer 0 Period Register 2 MSW */
TIMPRD1 = TIMER_PERIOD & 0xFFFF ;     /* Timer 0 Period Register 1 LSW */
TIMCNT1 = 0 ;
TIMCNT2 = 0 ;
TIAFR = RESET_ALL_TIMER_FLAGS ;
IFR0 = 0x0000 ;                        /* Interrupt Flag Register Bit 4: Timer Flag*/
IER0 = 0x0010 ;                          /* Interrupt Enable Register Bit 4: Timer Interrupt Mask */
TIMER0_INT_FLAG = 1 ;
TCR = 0x8027 ;                        /* Bit 15=ENABLE, Bits 5:2= Prescaler 2**1-2**13, 1:Autoreload, 0:Start */
}

 

interrupt void Timer_isr(void)
{
TIAFR = RESET_ALL_TIMER_FLAGS ;
if(Timer_alt) { Timer_alt = 0 ; USBSTK5515_LED_on( 0 ); }
else { Timer_alt = 1 ; USBSTK5515_LED_off( 0 ); }
Timer0_flag = 1 ;
}

 

Regards'

Manish

  • Manish,

    CPU registers start from 0x0000 only and IER0 is the first register hence you are seeing its address as 0x0000. See soc.h file in CSL and section 2.2 "Memory Mapped Registers" in C55x CPU reference guide for more details.

     

  • maybe you can try to set IFR0 to clear: 

    IFR0 = 0x0010; // set timer interrupt flag to clear

    also you can reference the sample for evm5515 at http://support.spectrumdigital.com/boards/evm5515/revb/files/evm5515_demo.zip

    this sample include the setting for timer.