Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4923

Trying to understand registers on MSP430G2553

$
0
0
Code (Text):
  1.  
  2. #include <msp430.h>
  3.  
  4. void main(void) {
  5.     WDTCTL = WDTPW | WDTHOLD;       // Stop watchdog timer
  6.  
  7.     P1DIR |= (BIT0+BIT6);           // P1.0 (Red LED), P1.1 (Green LED)
  8.  
  9.     while(1)
  10.     {
  11.         volatile unsigned long i;
  12.  
  13.         P1OUT &= ~BIT6;             //Green LED -> OFF
  14.         P1OUT |= BIT0;              //Red LED -> ON
  15.  
  16.         for(i = 0; i<10000; i++);   //delay
  17.  
  18.         P1OUT &= ~BIT0;             //Red LED -> OFF
  19.         P1OUT |= BIT6;              //Green LED -> ON...
Trying to understand registers on MSP430G2553

Viewing all articles
Browse latest Browse all 4923

Trending Articles