I am trying to blink an LED once a second, here is my code.
It is doing the blinking every one second, but I am puzzled by why the frequency is 1 Hz.
I use SMCLK which defaults to 1 MHz
Given a divider of 8 and a count up to 0xFFFF which is 65535, shouldn't I be getting every 2 seconds for a blink?
#include "msp430f5529.h"
int main(void) {
WDT_A_hold(WDT_A_BASE);
P1DIR |= BIT0;
TA1CCTL0 = CCIE;
TA1CTL = TASSEL_2 + MC_2 + TACLR + ID_3;
//TA1CCR0 = 65535;
//TA1EX0 |= 0x0000;
__bis_SR_register(GIE); /* Enable maskable interrupts */
while(1) { /* CPU does nothing and thus no harm */ }
return (0);
}
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR(void)
{
P1OUT ^= BIT0;
}