Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Understanding setting timer trigger periods

$
0
0

I'm setting my Stellaris Launchpad clock speed at 40Mhz (at least I *think* I'm doing that :)):

SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

I need an interrupt to fire every 26.4us, so I'm doing something as follows:

// ...timer setup code...

TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet() / 1000 / 1000 * 26.4);

This is obviosuly not right (getting a FaultISR).

What's the correct way of doing this?

Thanks!


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>