MSP430 Work with the LED

This article for those who wants to find out how to work with the LED

You can find the software «TiTAN_example_01_simply_led_blink»  at the link https://titan-project.com/en/software/

This lesson will focus on two development environments for microcontrollers with the MSP430 core, which is the basis for TiTAN boards. For this reason, this lesson will be divided into two parts.

In the first one, we’ll explore a free Web-based development environment given by Texas Instruments. It is located at the address https://dev.ti.com

TI Cloud Tools by Texas Instruments

To work with it, you need to create an account or log in under an existing one. When you first visit it, carefully follow the tips and recommendations on the page. They will help you to install and configure a special program to work with the programmer-debugger. Then go to the CSS Cloud section.

MSP430 Work with the LED. Practice.

For the first acquaintance with the development environment, download the project “TiTAN_example_01_simply_led_blink” at the link https://titan-project.com/en/software/.  Let’s examine what happens in the project.

Line “WDTCTL = WDTPW | WDTHOLD;” disables the Watch Dog timer. As in the MSP430 core this timer starts immediately with the core startup it must be disabled and enabled only under control. Otherwise, you will be looking for the causes of failures of the program, not knowing that the Watch Dog spoils your life.

The next function “SetSystemClock20MHz ();” sets the internal oscillator to 20MHz. This function, like the “delay_ms ();” function, is declared in the ” system.h”. All internal peripherals of the microcontroller also switch to this frequency.

According to Texas Instruments technical information, 20MHz is the limit frequency of the microcontroller. In fact, in some cases, the core can be run from an external 26mhz quartz resonator connected to the RF node of the microcontroller.

In the future, we will definitely tell you how to set the frequency of the core and peripherals separately.

With the command “LEDDIR |= LED;” set the direction of the output connected to the led. Macros “LEDDIR”, ” LED “and others are described in the file “main.h ” which will make it easier to work with TiTAN in the future.

And finally, in an infinite loop, the led state is alternately switched every 500 milliseconds.

It’s time to assemble our project.

If the compilation went without errors in the output line you will see something like this picture.

Connect the Titan Board to the USB and load the program into it by pressing the “Run” button.

The download process will take quite a bit of time and at the end the program will run automatically

Congratulations, you have successfully mastered the first development environment for TiTAN.

Now, you upgraded your skills in MSP430 work with the LED

MSP430 Work with the LED – Video