Blame | Last modification | View Log | RSS feed
//******************************************************************************// MSP430x4xx Demo - Software Toggle P5.1//// Description; Toggle P5.1 by xor'ing P5.1 inside of a software loop.// ACLK = n/a, MCLK = SMCLK = default DCO//// MSP430x4xx// -----------------// /|\| XIN|-// | | |// --|RST XOUT|-// | |// | P5.1|-->LED//// A. Dannenberg// Texas Instruments, Inc// January 2006// Built with CCE for MSP430 Version: 3.0//******************************************************************************#include "msp430f412.h"int main(void){WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timerP5DIR |= 0x02; // Set P5.1 to output directionfor (;;){volatile unsigned int i; // volatile to prevent optimizationP5OUT ^= 0x02; // Toggle P5.1 using exclusive-ORi = 10000; // SW Delaydo i--;while (i != 0);}}