Skip to content
Snippets Groups Projects
Commit 027a587a authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

msp430fr5994lp timer: add setup_hz for very low frequencies

parent 6dce5ced
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,13 @@ class Timer { ...@@ -62,6 +62,13 @@ class Timer {
TA0CCR0 = 2000000UL / frequency; TA0CCR0 = 2000000UL / frequency;
TA0CTL |= TACLR; TA0CTL |= TACLR;
} }
inline void setup_hz_low(uint16_t const frequency) { // 250 kHz base
TA0CTL = TASSEL__SMCLK | _TA0_MAIN_DIV;
TA0EX0 = 7;
TA0CCR0 = 250000UL / frequency;
TA0CTL |= TACLR;
}
#endif #endif
inline void start(unsigned char const interrupt) { inline void start(unsigned char const interrupt) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment