# [General]MSP430 F5529 LaunchPad Evaluation on ENERGIA IDE

Status
Not open for further replies.

##### Newbie level 3
1. Where to find out that where is the words specified for pin configuration on the Launchpad board.
Such as RED_LED, GREEN_LED. Is there any header file explaining the denotions?

2. Immediately, when the program is downloaded into the Launch Pad. The LEDS are not working, since I press the reset or bsl button which makes the leds blinks?

3. The LEDS are working in following manner: Can you tell why is it like that?

1. RED - 1 GREEN - 1

2. RED - 1 GREEN -0

3. RED - 0 GREEN -0

4. RED - 0 GREEN - 1

Code C - [expand]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//#define LED RED_LED

void setup()

{

// put your setup code here, to run once:

pinMode(GREEN_LED, OUTPUT);

pinMode(RED_LED, OUTPUT);

}

void loop()

{

led1();

led2();

}

void led1()

{

digitalWrite(RED_LED,HIGH);

delay(1000);

digitalWrite(GREEN_LED,LOW);

delay(1000);

}

void led2()

{

digitalWrite(RED_LED,LOW);

delay(1000);

digitalWrite(GREEN_LED,HIGH);

delay(1000);

}

Last edited by a moderator:

#### doraemon

##### Super Moderator
Staff member
Hello!

I suppose you are using what they call MSP430Ware or something like that. I think if you really want
to understand MSP430, the best thing is to download the hardware files from the following page:
https://www.ti.com/tool/msp-exp430f5529lp
And then write your own code based on TI examples.

- Don't use the launchpad examples (MSP-EXP430F5529LP Software Examples, slac623e.zip). These
examples are based on a hardware abstraction layer. Before that, you should first understand what happens
under the abstraction layer.
- My advice: use the F55xx specific examples (without abstraction layer) that can be downloaded from TI.
The file name is SLAC300n.zip, n being the version code. Today, it's slac300h.zip.

I had a look at the hardware file. The user leds (look at sheet 2 of the schematics) are on port 4.7
and on port P1.0
If you want to blink the LEDs, you may try this one using code composer studio:
NB: I don't know which LED is green or red, so I will name them LED1 (for port 1) and LED4 (for port 4).

Code C - [expand]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "MSP430F5529.h"

#define    LED1    0x01
#define    LED4    0x80

void main(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog
P4DIR |= LED4;   // LED4 bit in output
P4OUT = &= ~LED4; // LED4 bit at 0 -> LED4 off
P1DIR |= LED1;  // LED1 bit in output
P1OUT \$= ~LED1;  // LED1 bit at 0 -> LED1 off
// Set the debugger breakpoint at next line
P1OUT |= LED1; // LED1 on
P1OUT &= ~LED1; // LED1 off
P4OUT |= LED4; // LED4 on
P4OUT &= ~LED4; // LED4 off
}

Dora.

PS: the above code has been written in EDABoard editor. I wouldn't trust my memory that much,
so there might be a few errors, but the principle is here.

Status
Not open for further replies.

Replies
1
Views
2K
Replies
2
Views
966
Replies
2
Views
2K
Replies
2
Views
793
Replies
8
Views
5K