RumiKumi 0 Posted January 25, 2012 Share Posted January 25, 2012 Hi huys, I am currently using only TimerA in my code and here is code of use: //choosing clk down below BCSCTL1 |= XTS; do { IFG1 &= ~OFIFG; for (i = 0xFF; i > 0; i--); } while ((IFG1 & OFIFG) == OFIFG); BCSCTL1 |= DIVA_1; BCSCTL2 |= SELM0 | SELM1; // setting-up timerA for 500khz and interruption each 100ms TACTL = TASSEL_1 + MC_1 +ID_3; CCR0=50000; _EINT(); for (; { _BIS_SR(LPM3_bits); // service of interrupts here } #pragma vector=TIMERA0_VECTOR __interrupt void Timer_A (void){ _BIC_SR_IRQ(LPM3_bits); // doing things each 100ms } I need to use also TimerB, so how to add it using same clock or different ? I am asking becouse i dont know what registers to set up to avoid conflict of variables. How to do add other TimerB using same clock as TimerA or different ? Quote Link to post Share on other sites
greeeg 460 Posted January 26, 2012 Share Posted January 26, 2012 Be careful. Most MSP devices only contain 1 base timer module. Within that 1 timer module there may be several CCM's (Capture/compare modules) each CCM can cause an interrupt when the TAR (timer value) matches the CCR (Capture compare register) If you tell us what IC you are using I can clarify more, but if your device has got a timerB module you should be able to set it up identically to your timerA module just replace the A's with B's Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.