Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 dpurdie 1
//******************************************************************************
2
//  MSP430x6xx Demo - Software Toggle P1.0
3
//
4
//  Description; Toggle P1.0 by xor'ing P1.0 inside of a software loop.
5
//  ACLK = n/a, MCLK = SMCLK = default DCO
6
//
7
//                MSP430x6xx
8
//             -----------------
9
//         /|\|              XIN|-
10
//          | |                 |
11
//          --|RST          XOUT|-
12
//            |                 |
13
//            |             P1.0|-->LED
14
//
15
//  M. Pfeiffer
16
//  Texas Instruments, Inc
17
//  March 2009
18
//  Built with CCS for MSP430 Version: 4
19
//******************************************************************************
20
 
21
#include "msp430f6638.h"
22
 
23
int main(void)
24
{
25
  WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer
26
  P1DIR |= 0x01;                        // Set P1.0 to output direction
27
 
28
  for (;;)
29
  {
30
    volatile unsigned int i;            // volatile to prevent optimization
31
 
32
    P1OUT ^= 0x01;                      // Toggle P1.0 using exclusive-OR
33
 
34
    i = 10000;                          // SW Delay
35
    do i--;
36
    while (i != 0);
37
  }
38
}