Jump to content

Getting current ulPeriod

Recommended Posts

I developed working code for TIMER0 interrupt on my TM4C129. But I would like to also get the current period. I assumed TimerLoadGet would return this but I get zero. I've tried all three of these functions with ROM_ and without. The peripherals manual doesn't help with info like "Returns the load value for the timer" 


   returns 0 for             uint32_t TimerLoadGet(TIMER0_BASE, TIMER_TIMA_TIMEOUT)
   returns 0 for             uint32_t TimerValueGet(TIMER0_BASE, TIMER_TIMA_TIMEOUT)
   returns 65535 for     uint32_t ROM_TimerMatchGet(TIMER0_BASE, TIMER_TIMA_TIMEOUT)
Can anyone direct me to a better explanation of these three? How can I get the Period?
P.S. I new to the Launchpad coming from Arduinos. These forums could use more sample code.
Link to post
Share on other sites


Not apropos of your question, but if you haven't already looked at it, be sure to take a look at Energia, it is a port of Wiring/Arduino environment for the Tiva launchpads.


Aside from looking in the driverlib manual (SW-TM4C-DRL-UG-, and in the TM4C129 datasheet, the source code for driverlib is also a useful resource.

Looking in timer.c, I note that the second argument to TimerLoadGet is supposed to be either TIMER_A or TIMER_B, so since you are feeding it some other argument

that may be why not getting expected output.  (Actually it looks like if you give it any value except for TIMER_A as the second argument, then it reads TIMER_B ).

Likewise for TimerValueGet and TimerMatchGet


Looking at the source code for Energia can be helpful source of some examples using some of the peripherals.

Personally, I also use the source code for eLua as a source for examples (I ported eLua to the Tiva launchpad, so I have it conveniently available,

would not necessarily suggest it as a general resource.)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...