1283 views|0 replies

6555

Posts

0

Resources
The OP
 

MSP430 LaunchPad Timer Interrupt (Continuous Mode) [Copy link]

#include <msp430g2231.h>


int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;


P1DIR |= 0x01;
TACCTL0 = CCIE; // Enable the interrupt generated by the CCIFG flag
TACCR0 = 50000; (After some testing, this sentence can be omitted)
TACTL = TASSEL_2 + MC_2; // Select timer clock and mode

// _BIS_SR(GIE);
_EINT(); // Enable the general interrupt
while(1);
}


/*Interrupt service routine*/
#pragma vector = TIMERA0_VECTOR
__interrupt void Timer_A(void)
{
P1OUT ^= 0x01;
}

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list