Hello,
I would like to know how to implement and use a Software timer on msp430.
I've been using msp430f5529.
Thank You
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.
Hello,
I would like to know how to implement and use a Software timer on msp430.
I've been using msp430f5529.
Thank You
Hi Maisie!
You may want to look at the code examples for the MSP430F5529. They include various examples for using the internal timer(s) of the microcontroller:
The configuration and best mode of operation depends on your specific application. So what do you plan to do?
Dennis
You cannot implement software timer without help from hardware timer. So you shall get familiar with hardware timer first, build code that calls timer interrupt service routine (ISR) 100 or 1000 times per second. Then next step would be implementing software timer(s) code in the hardware timer ISR. Example of supersimple implementation of two software period timers:
volatile counter1 = 0; volatile counter2 = 0; hw_timer_isr() { // running 100 times/sec if (++counter1 >= 10) { do_something_each_100msec(); counter1 = 0; } if (++counter2 >= 100) { do_something_each_1sec(); counter2 = 0; } }
**Attention** This is a public forum