Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:31:28+00:00 2026-06-05T17:31:28+00:00

I am using MSP430F5418 with IAR EW 5.10 . I want to use Timer

  • 0

I am using MSP430F5418 with IAR EW 5.10.
I want to use Timer B in up mode.

I want to use two interrupts.
TimerB0(1 ms) and TimerB1(1 second).

My Configuration is

TBCTL = MC__UP + TBSSEL__ACLK + TBCLR;
TB0CCTL0 = CCIE;
TB0CCR0 = 32;

TB0CCTL1 = CCIE;
TB0CCR1 = 32768;

On the ISR I just toggled two pins.
But only the pin for TB0CCR0 is toggling.
My Pin Configurations are correct.
Can anyone tell me why??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:31:29+00:00Added an answer on June 5, 2026 at 5:31 pm

    I suppose your problem is the timer period.
    MC__UP Up mode: Timer counts up to TBxCL0

    So your timer TBxR will reset to 0 when it reaches TBxCL0 which seems to be the value TB0CCR0.

    So it can never reach the value of 32768.

    You could switch TB0CCR0 with TB0CCR1, so your period will be 1 second.
    And to get your 1ms interrupt you need to increment your TB0CCR1 each time.

    INTERRUPT ISR_1MS()
    {
      TB0CCR1 = (TB0CCR1 + 32) & 0x7FFF;
    }
    

    But normally you don’t need a second timer for a second intervall.
    You could simply count 1000 times your 1ms intervall.

    INTERRUPT ISR_1MS()
    {
      ms_count++;
      if (ms_count >= 1000)
      {
        ms_count=0;
        // Do your second stuff
      }
    }
    

    And if you need more and different intervalls, you could change to another model.
    To a system clock time and check only against this time.

    volatile unsigned int absolute_time=0;
    
    INTERRUPT ISR_1MS()
    {
      absolute_time++;
    }
    
    unsigned int systime_now(void)
    {
        unsigned int result;
        di();
        result = absolute_time;
        ei();
        return result;
    }
    
    uint8_t systime_reached(unsigned int timeAt)
    {
       uint8_t result;
       result = (systime_now() - timeAt ) < 0x1000;
       return result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MSP430F5418 with FreeRTOS 7 in medium data model. I want to
I am using MSP430F5418 with IAR EW 5.10. I am trying to output the
I am using MSP430F5418 wit IAR EW 5.10. In my project I am using
I am using msp430f5418, with IAR Embedded workbench 5.10. A Graphical LCD (ST7565R) is
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using WPF/PRISM I want to log my messages through ILoggerFacade to my GUI (A
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
Using Yii, I want to delete all the rows that are not from today.
Using restlet, I want to make a post to android's c2dm service. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.