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.

OMAPL138 Timer 64 problem

Hi! I´m using a LCDK138 board. It's been working great for me, and now I'm trying to work with the timer 64 module. I've been able to make it work when PLUSEN is disabled, but as soon as I enable it it stops working, even if that's all I do (I don´t change CAPMODE or any other register). I'd like to know if there is a reason this is happening.

I'll place the code I'm using below, and I'll show the part I add when it all falls apart. To check if it's working I have an ISR that counts the number of times the T64P0_OUT12 is thrown. When I don´t use the PLUSEN I get a number according to the time I left it running, if I use the PLUSEN only one interruption is counted.

void tmr_setup() {

Tmr0Regs->TGCR = 0;
Tmr0Regs->TGCR |= (1 << 2); // TIMMODE
// Tmr0Regs->TGCR |= (1 << 4); <--- This is the bit for the PLUSEN
Tmr0Regs->TGCR |= (1 << 0); // TIM12 not in Reset

Tmr0Regs->PRD12 = 0;

Tmr0Regs->PRD12 |= (150000 << 0); // (150MHz / n)

Tmr0Regs->REL12 = 0;
Tmr0Regs->REL12 |= (150000 << 0);

Tmr0Regs->TCR = 0;
Tmr0Regs->TCR |= (0 << 8); // Internal Clock
Tmr0Regs->TCR |= (3 << 6); // Enable 12, with cont. op. and prd reload

}

  • Hi,

    Kindly let us know which project you are working on and doing the changes you have specified.

    Is it from the C6748 starterware examples or your custom code?

     

    Regards

    Iyshwarya

  • Hi Iyshwarya,

    This is part of my own code. The pinmux has been done right. As I'm telling you it does work as long as I don't use the PLUSEN features.

  • Hi,

    From the code you have posted we have the following suggestions.

    • From the code the TIMMODE bit has been  set to the dual 32-bit timer unchained mode but you have mentioned you need to work with the timer 64bit mode.

    Tmr0Regs->TGCR |= (1 << 2); // TIMMODE

                Kindly verify the mode which you need the timer to work.

    • Please review the 64-Bit Timer User's Guide(link given below),  Section 2.1.5.2 "Writing to Registers of an Active Timer".

    http://www.ti.com/lit/ug/sprufm5d/sprufm5d.pdf

    That section states which registers may not be written during active timer operation. If you wish to change any of those timer registers during active operation, you must stop the timer, write to them as needed, and then resume the timer counting.

    • Also verify whether your code complies with the  64-Bit Timer User's Guide(link provided above), Section  2.1.4.1.3 “64 Bit Timer Configuration Procedure” to configure the timer in 64-Bit timer mode.

    Regards,

    Iyshwarya

    If this answers your question, please click the Verify Answer button below. If not, please reply back with more information.