Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Buildng millis() function with watch dog interrupt

$
0
0

Hello all together,

It is the first time, that I ask a question here, and I think not the last time. I want to ask, if it is possible to build a function that is showing the milliseconds from the startup of the Microcontroller without one of the both timers, but the watch dog. When my Chip is running on 1MHz, I could set my watch dog to 1ms, and cause an interrupt. Then I would have an interrupt every 1000 cycles. When the interrupt occurs, I just add 1 to a word, and then I always know the Millisecond until the overflow.
Then I have for slow operations like blinking lights a milliseconds function and for faster operation I can use the two timers for pwm.
So I don't want or need working code from you, I just want to know if I go in the wrong direction, and then find it out myself, that is mostly the best way for me in learning things.
Because with a function that is showing the milliseconds (like ms() in Arduino or Energia) and two working timers it would be great for my needs.

Greetings,

Sven


Viewing all articles
Browse latest Browse all 2077

Trending Articles