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.

How-To use C553x interrupts without CSL

Hey everybody,

as promised in my last post (http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/t/231388.aspx) here is the example how to use a timer on C553x with interrupt without using CSL. To use that example you will need the attached 'vectors.asm' ( based on C5505eZdsp demo vectors.asm), which is updated to be compatible with the interrupt table of C553x DSPs and the attached file 'interrupts.h', which holds some simple functions to use interrupts. Also you will need my 'registers.h' (please refer to my post above), which is based on 'registers.h' from CSL V3 programmer example but extended and changed to use same phrases as in datasheet.

Here is the example:

// includes --------------------------------------------------------------------------- //
#include "registers.h"
#include "interrupts.h"

// variables -------------------------------------------------------------------------- //

// prototypes ------------------------------------------------------------------------- //
interrupt void irq_timer(void);

// main =============================================================================== //

void main(void)
{
    // init ---------------------------------------------------------------------------
    IODIR1 |= (1<<GPIO14);                                                                                          // set GPIO14 to output
    
    TCR0        |= (1<<TIMEN) | (1<<AUTORELOAD) | (DIV16);                                // timer and prescaler on, prescaler output: 100MHz / 16 = 6250000 Hz
    TIMPRD01    = 62500;                                                                                              // timer period: 6250000Hz / 62500 = 100 Hz (10ms)
    TIAFR         = TIMFLAG_CLEAR;                                                                              // clear all previous timer interrupts
    
    IRQ_hook_func(irq_timer, ISR_TINT);                                                                   // hook interrupt function in vector table
    IRQ_enable(ISR_TINT);                                                                                           // enable TINT interrupt in IERx register
    IRQ_globalEnable();                                                                                                 // globally enable interrupts (INTM)
    
    TCR0        |= (1<<START);                                                                                        // start timer
    
    // main ---------------------------------------------------------------------------
    while(1) {}
}

interrupt void irq_timer (void) {
    
    TIAFR |= (1<<TIM0FLAG);                                                                                        // delete all timer irq flags
    IODATAOUT1 ^= (1<<GPIO14);
}

Regards,

Max

Includes.zip