Advertisement
carlsondc

toggle.c

Dec 29th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include "msp430.h"
  2.  
  3. #define BSLSKEY_ 0xFFDE
  4. const_sfrw(BSLSKEY, BSLSKEY_);
  5. BSLSKEY = 0;
  6.  
  7. void main(void)
  8. {
  9.   WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
  10.   P6DIR |= 0x01;                            // Set P6.0 to output direction
  11.   P6SEL &= ~0x01;                            // Set P6.0 to output direction
  12.  
  13.   for (;;)
  14.   {
  15.     volatile unsigned int i;
  16.  
  17.     P6OUT ^= 0x01;                          // Toggle P6.0 using exclusive-OR
  18.  
  19.     i = 50000;                              // Delay
  20.     do (i--);
  21.     while (i != 0);
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement