The last two lines in your main loop: (a) Start the timer (MC_2), then (b) stop it (TACTL=MC_0). Timer_on doesn't start the timer, but waits, expecting it to be running, but it isn't running since you just stopped it. Did you intend those last two lines in the loop (initialize(); TACTL=MC_0;) to be in the opposite order? Or did you mean for Timer_on to start the timer (MC_2)? (At first glance, the latter might work out better.)
↧