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.

RTI Timer Interrupt Not Work (Delay)

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

I have a tms570ls3137 hdk board. I want to make delay with timer. I can create delay without timer but i want to use that way.

I read TI rti application notes and i wrote that codes...Assume i added all headers and C files (halcogen v3.1.1).

-----------------------------------------------------------------------------------------------------------------

Main.c file;

-----------------------------------------------------------------------------------------------------------------

void timer()

{

rtiEnableNotification(rtiNOTIFICATION_COMPARE2);

rtiStartCounter(rtiCOUNTER_BLOCK0);

}

void main()

{

hetInit();

rtiInit();

_enable_FIQ();

_enable_IRQ();

hetPORT1->DIR = 0x80000001;

while(1){

hetPORT1->DOUT = 0x00000001;

hetPORT1->DSET = 0x00000001;

timer();

}

}

-----------------------------------------------------------------------------------------------------------------

And notification.c file;

-----------------------------------------------------------------------------------------------------------------

void rtiNotification(uint32_t notification)

{

hetInit();

hetPORT1->DIR = 0x80000001;

hetPORT1->DOUT = 0x80000000;

hetPORT1->DSET = 0x80000000;

}

I am sure codes are true. But not work :(

  • Hi,

    I'm not sure I really understand what you are trying to do.

    The RTI module is used to generate time bases.
    Let say you want a tick interrupt every 1ms.
    The RTI has to be program accordingly, and every 1ms an RTI interrupt will be fired.
    On every tick, the CPU will execute the rtiNotification routine. In  your case, you can toggle your HET pin.

    What you are trying to do looks like you have an OS running and you want a task to sleep for a specific amount of time and resumes when the sleep time is done.

    I've attached an example using RTI to toggle an GIO pin every 1s.

    5238.example_rtiBlinky.c

    Please have a look and let me know if this is useful.

  • Hi Jean-Marc,

    I would like to use the RTICompare0 with ADC1 :
    I am reading a signal (AB) from a Signal generator and I can get the signal on ADC1

    To add interruption, I used the Halcogen to configure the VIM on Compare0, and the RTI on Counter0.

    The issue :

     in the main I : rtiEnableNotification , rtistartcounter, and while(1)

    - in the rtiCompare0Interrupt I just put start my adc conversion  and wait for conversion completed

    - in the rtiNotification I get the rti data

    => I can see that rtiCurrentTick give me something, but the Interruption doesn't work fine, I just stay in my infinite while, and never reach the rtiCompare0Interrupt

    Can you help to figure out what is missing in my implementation ?

    Rgds

    Brice

     

     

  • I answer myself,

    I had to use :

    __enableIRQ

    it works fine now