From 79326550854ee27015454e2f1d6385af68ce552f Mon Sep 17 00:00:00 2001 From: anujpurwar007 <33223077+anujpurwar007@users.noreply.github.com> Date: Mon, 30 Oct 2017 23:13:43 +0530 Subject: [PATCH] hello_led This is a simple C program for MSP430 MCU on CCS platform --- hello_led | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 hello_led diff --git a/hello_led b/hello_led new file mode 100644 index 0000000..9271ddc --- /dev/null +++ b/hello_led @@ -0,0 +1,29 @@ +#include //a header file to include library of msp + +/* + * main.c + */ + int i; +int main(void) { + WDTCTL = WDTPW | WDTHOLD; + // Stop watchdog timer to reset(everything goes to 0 or initial stage) the system ,this timer tells the system which task to fetch from where if it goes to an undefined state + //we dont want this timer to work at present as we r in a initial state + //if in the watchdog mode it will work as and if in interval mode it will work as + //non maskable interrupt + + P1DIR&=0x01; P1DIR&=0x40; //P1DIR sets the first port as input + while(1) { + + P1OUT^=0x01; + for ( i=0;i<15000;i++); + + //P1DIR|=0x01; + + +// P1OUT^=0x00; + //for(j=0;j<15000;j++); +P1OUT^=0x40; + } + + return 0; +}