Professional Documents
Culture Documents
// MSP430G22x1
// -----------------
// | |
// >---|P1.1/A1 P1.0|-->LED
//
//******************************************************************************
#include "msp430G2231.h"
main()
{
//***Configure clock
// we need DCO@1MHZ -> SMCLCK -> TA
BCSCTL1 |= CALBC1_1MHZ; //
DCOCTL |= CALDCO_1MHZ; // dco at 1mhz
BCSCTL2 &= ~SELS; // select dco for smclck source
BCSCTL2 |= DIVS0; // select no division
//***Enable interrupts
_BIS_SR(GIE); // general interrupt enable
//***Pins config
P1DIR = BIT0; // P1.0 output
P1SEL = BIT1;
P1OUT=0; // turn led off
//***Loop
while (1)
{ }
}