Is it possible to connect Arduino IDE and TiTAN boards based on MSP430?

We receive many questions about the possibility of developing programs in the Arduino IDE for the TiTAN and TiTAN-I boards. Let’s try to contemplate the question.

Initially, the mission of the TiTAN-project is to help those developers who are no longer lacking the 8-bit microcontrollers, and 32-bit microcontrollers are still difficult to learn. Microcontrollers with MSP430 core are 16-bit. This makes it easier to move to 32-bit. 

The Arduino IDE was aimed at 8-bit microcontrollers with an AVR core. Due to the high popularity of the Arduino IDE, it has become overgrown with a huge number of libraries and examples. Many subtleties of working with the core and microcontroller hardware have become hidden from the developers. This indeed speeded up the process of developing amateur designs and prototypes, but made it impossible to debug the program step by step. That’s why the final firmwares are getting a little bigger and slower in some cases.

We agree with the developers who say, “I just need to test the algorithm.” This is a very significant argument. Moreover, the Arduino IDE has already been able to connect with some 32-bit microcontrollers. So why not try programming TiTAN in the Arduino IDE? Let’s try?

A search on the Internet led us to a very interesting project that was once started by the panStamp company. Unfortunately, their project is now suspended, but they have kindly saved for all of us all the information on this link http://old.panstamp.com/. 

So let’s get started.

Install and run the Arduino IDE. Go to the menu «Files»->«Preferences». We are interested in the field Additional Boards Manager URL’s. Enter the address «http://panstamp.org/arduino/package_panstamp_index.json». Close the “settings” menu.

Then go to the menu “Tools” -> “Board: …” -> “Boards Manager”. Enter “panStamp” in the filter line. Install the package “panStamp NRG w / CC430F5137”. After the installation, in the list of boards we will see the tab “panStamp MSP430 boards” and there will be four boards inside. But we cannot program the TiTAN boards yet. There is a few more steps to follow.

We need to install the console program to work with the ez-FET programmer-debugger built into TiTAN by downloading it from the Texas Instruments website using this link https://www.ti.com/tool/MSP430-FLASHER

Now let’s add the information about our programmer to the panStamp package in the Arduino IDE. To do this, go to the directory C:\Users\{USERNAME}\AppData\Local\Arduino15\packages\panstamp_nrg\hardware\msp430\1.1.0\

And in the programmers.txt file, add two lines:

eZ-FET.name=eZ-FET

eZ-FET.protocol=eZ-FET

In the boards.txt file, add the TiTAN board after the line menu.rfloader=Wireless bootloader

##############################################################

nrg4.name=TiTAN 1.0 w/cc430f5137

nrg4.build.core=panstamp

nrg4.upload.tool=eZ-FET

nrg4.upload.protocol=eZ-FET

nrg4.upload.maximum_size=32640

nrg4.build.mcu=cc430f5137

nrg4.build.f_cpu=12000000L

nrg4.build.variant=titan_1.0

nrg4.build.board=TiTAN

nrg4.ldscript=ldscript

Add to the “platform.txt” file

# eZ-FET programmer

tools.eZ-FET.upload.params.verbose=

tools.eZ-FET.upload.params.quiet=

tools.eZ-FET.cmd.path=’C:\ti\MSPFlasher_1.3.20\MSP430Flasher.exe’

tools.eZ-FET.upload.pattern={cmd.path} -g -s -w {build.path}/{build.project_name}.hex -z [RESET,VCC]

Now, in the “variants” directory, create a “titan_1.0” directory and copy there the “pins.h” file from the “panstamp_nrg_1.0” directory.

Replace lines in it

#define ONBOARD_LED 19

#define LED      ONBOARD_LED

#define INIT_ONBOARD_LED()    PJDIR |= BIT1; PJOUT &= ~BIT1

To lines

#define LED_BUILTIN 0

#define LED      LED_BUILTIN

#define INIT_ONBOARD_LED()    P1DIR |= BIT0; P1OUT &= ~BIT0

This will allow us to match the location of the LED.

Almost everything is done! Let’s try?

Restart the Arduino IDE. Open the “Blink” example from the “01.Basics” section. In the “Tools” menu, select the “TiTAN 1.0 w / CC430F5137” board and the “eZ-FET” programmer and try to put together the «Sketch»->«Verify/Compile» project. Does it work?

C:\Users\Ольга\Documents\Документы Ольга\Производство\TiTAN\Для соц.сетей\Arduino and TiTAN\image1.png

It remains to click the “Upload” button.

In the console, we can see the information that MSPFlasher has given us when loading our program.

C:\Users\Ольга\Documents\Документы Ольга\Производство\TiTAN\Для соц.сетей\Arduino and TiTAN\image2.png

The Arduino IDE and the TiTAN are connected!

In the next posts we will tell you how to load a firmware into the TiTAN-I board with the help of the Arduino IDE without having a debugger programmer, consider examples and libraries that the panStamp company has kindly left us.