The best blog to get started with MSP430 would be : MSPSCI Blog
This blog covers all the basics required to get started with the development process. I have used MSP430G2553 microcontroller on a launchpad board for this project.
Hardware: Although, there is an on-board LED, I have used an external one and have connected everything on a breadboard. (Picture will be added soon).
Code: There is a default project called Blink.c (CCS), you may use that or the below mentioned code.
#include<msp430.h> void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR |= BIT0; // Set P1.0 to output direction for(;;) { volatile unsigned int i; // volatile to prevent optimization P1OUT ^= BIT0; // Toggle P1.0 using exclusive-OR __delay_cycles(100000); //delay of 10000 cycles at 1MHz } }
No comments:
Post a Comment