This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I am clueless reading datasheets... LED's and GPIO

Other Parts Discussed in Thread: MSP430FR6989

So, I'm a self taught programmer trying to learn embedded stuff just for fun. I finally have a software build environment and was excited to get cracking. But I can't get past the provided blink.c program.


Clearly I'm missing the basics, and I've got a couple books on the way to help with a general overview of embedded programming, but I don't understand how to read a datasheet.


So in blink.c, turning on the led is setting Port 1, Pin 0 as output. When I look at the datasheet for Port 1 I see this:

P1.0/TA0.1/DMAE0/RTCCLK/A0/C0/ VREF-/VeREF-

And in the function list I don't see anything regarding a LED, let alone one of two that are there. Clearly I'm looking in the wrong area. Can anyone help me understand what I'm supposed to be looking at? Obviously 1.0 is i/o, but where can I find the information that ties this to the LED?

Sorry for such a basic question.

  • There are hundreds of different MSP430 chips, and several different LaunchPad boards; it would be helpful to note which one you're using.

    Anyway, the chip does not have LED pins. It has general-purpose I/O pins, and the LEDs are connected to some of them. Setting that pin to output a high or low voltage (depending on the circuit) will light up the LED.

    You need to look into the user's guide of your board to see what hardware is connected to what pin. But with any luck, the pin number is printed near the LED on the board.

  • The datasheet only lists the technical capabilities of the particular device (MCU) and a schematically overview of all Port’s and port.Pin’s.

    The User's Manual of this device (MCU) family provides a description of how to use these technical possibilities and to set up inside the device.

    LaunchPad or EVM User's Guide provides an example of how external components (LED) can be connected to this device.

    The offered example software provides a brief example of how the internal device elements can be set, sometimes in conjunction with a LaunchPad or EVM.


    All documents can be found and downloaded from the specific device web page.

  • As others pointed out, LEDs are not part of the MCU, they are just an external load you attach to it.

    When I look at the datasheet for Port 1 I see this:

    P1.0/TA0.1/DMAE0/RTCCLK/A0/C0/ VREF-/VeREF-

    This means, the pin can have one of the listed functionalities, which are usually mutually exclusive, i.e. only one at a time. This is a method of "saving" pins. Most users/applications don't use all peripheral in all applications. So, to fit multiple peripheral functions to a device having a small number of pins, most pins are multiplexed, i.e. can assume several functions. Which one is listed in the datasheet/manual, as well as the default function, which the pin assumes after reset. The pin you mentioned can be a "normal" GPIO (P1.0 = PORT 1, Bit 0), which is what you want to drive a LED. The other functions are related to Timer, DMA, RTC, or analogue functionality - check the manuals to read more about them.

    Before attaching a LED, it is suggested to lookup the driving capacity of the pin (in GPIO mode), i.e. source/sink current, output voltages (H,L), and compare this with the requirements of the LED. Attach an appropriate series resistor, and you are done ...

  • Wow, thanks everyone for the great replies. I see where my confusion lies. I guess I figured that since the led is set into the board (it's an msp430fr6989) that it would be shown on the datasheet, but I can see why it wasn't.
  • Yes, the msp430fr6989 datasheet (and the MSP430FR5/6xxx Family User's Guide) covers just the microcontroller. The documentation for the MSP430FR6989 LaunchPad board lives here: http://www.ti.com/tool/msp-exp430fr6989.

**Attention** This is a public forum