Jeffrey's Log

Archives | Subscribe


Running MSP430F5529 Launchpad using GNU/Linux


I own an MSP430F5529 USB launchpad from Texas Instruments. Cheap in cost, this launchpad is a good resource for developing your USB applications. It has an open source onboard debugger eZ-FET lite.

For developing applications for MSP430, there is already a well maintained C toolchain(gcc-msp430) available. On an Ubuntu/Debian machine, you can install it using the below command
sudo apt-get install gcc-msp430 msp430-libc msp430mcu

For debugging purpose, I am using mspdebug. But I had some hard time in setting up this debugger on my GNU/Linux machine. Due to some driver issues, the default mspdebug package from Ubuntu repository didn’t work. To get it working, there are some extra packages provided by TI to be installed.

Another alternative was to get the pre-compiled mspdebug from Energia. Energia comes with all these issues solved. But if you want to try the hard way, refer this.

Below steps describe how to use mspdebug from Energia
1) Download Energia for GNU/Linux from http://energia.nu/download/
2) Extract the tgz file. I got a folder named energia-0101E0011. The number in the folder name might change for you depending on the energia version you are using.
3) Go into the folder energia-0101E0011/hardware/tools/msp430/bin/ using the cd command.
3) Copy libmsp430.so to /usr/lib/
4) Update the firmware of the debugger using sudo ./mspdebug tilib --allow-fw-update
5) Now you can run mspdebug using the following command sudo ./mspdebug tilib

If you were successful, you will get the mspdebug console
(mspdebug)

Now lets write a small code and see if we can flash it to the launchpad.

Save the below code as blink.c

#include <msp430.h>

main()
{
  unsigned int i = 0;
  P1DIR = 1;

  while(1)
  {
    P1OUT = 1;
    for (i=0; i < 65535; i++);
    P1OUT = 0;
    for (i=0; i < 65535; i++);
  }
}

Lets compile this software using the below command
msp430-gcc -mmcu=msp430f5529 -mdisable-watchdog blink.c

We need to flash the output of the above compilation to the launchpad. Launch mspdebug using sudo ./mspdebug tilib. Then run
(mspdebug) prog a.out
Note: Since mspdebug is inside the energia folder and this blink.c file is at another location, when using the prog command in mspdebug, you have to give the path to the a.out file i.e
(mspdebug) prog /path/to/the/file/a.out

Now the LED on the launchpad will start to blink!
MSP430F5529 blinking LED

Posted in: Electronics, MSP430 | Tagged under: , | 2 Comments

ATMEGA32U2 board using gEDA


Two years before I had designed a mini development board for AT90USB162. There was a small mistake in that board. It didn’t have the 1MFD capacitor connected across the UCAP (PIN 27) and ground. Because of that the board was not detected while connected via USB. Last month I thought of repairing that board and do some USB projects. I ordered samples of ATMEGA32U2 from ATMEL. Thanks ATMEL for the samples.

Today I did a small hacking on the board. I added the capacitor as needed by USB. Now the board is working fine. There came the next problem. GCC-AVR version which I had, didn’t support ATMEGA32U2. Also for loading the hex into the controller, I used the dfu-programmer. Since I had installed it from the Ubuntu repository, dfu-programmer was of older version and it also didn’t support ATMEGA32U2.

After a few Google search, I found that if you compile for AT90USB162, the hex generated is supported by ATMEGA32U2. So I wrote the C code and compiled it for AT90USB162. Next task was to make the dfu-programmer to work. The only solution was to get the latest code and compile it. Below shown is the way to compile the dfu-programmer from source

$ mkdir dfu-programmer
$ svn co https://dfu-programmer.svn.sourceforge.net/svnroot/dfu-programmer/trunk/ dfu-programmer
$ cd dfu-programmer/dfu-programmer
$ ./bootstrap.sh
$ ./configure
$ make

Once installed, flashing the controller is very easy. First we have to bring the controller into USB bootloader mode. For that first press and hold the RESET button. Then press and hold the HWB button. Now release the RESET button and then release the HWB button. This will bring the controller into USB bootloader mode. Now we can issue the following instructions to flash the controller.

$ dfu-programmer atmega32u2 erase
$ dfu-programmer atmega32u2 flash blink.hex
$ dfu-programmer atmega32u2 reset

This is an Open Hardware project and I will soon post the schematic and PCB layout once adding the missing capacitor in the old design. Below shown is the snap shot of the board.
ATMEGA32U2 gEDA PCB

Posted in: Circuit, Electronics, open hardware, tutorials | Tagged under: , , | 5 Comments

USB mp3 player connection diagram


Update: At present I don’t have the SD card connector circuit diagram. Please don’t post in the comments asking for the circuit.

Long back in my blog I had posted how to make an USB mp3 player.
http://jeffrey.co.in/blog/2009/08/usb-mp3-player/

This mp3 player is made using a Chinese mp3 decoder board. Find more about the mp3 decoder board at http://www.vire.net.cn/
You don’t have to order it from china. It is available from most of the local electronic shops in INDIA. I don’t know about other countries.

The board is self explanatory. It has proper silk screen markings which shows how to connect. But still many had posted comments in my blog for the connection diagram of this board. I think it is hard for an electronics beginner to connect the board. So I thought of posting the connection diagram.

On the rear side of the board, there are three connectors.
They are for
1) Player buttons and IR sensor
2) USB and MMC/SD card interface
3) Power supply

For the board to play music, it needs a 5V DC power supply, USB port, 3.5mm stereo jack and an IR sensor to detect the signals from remote. You can also add switches to control songs, SD/MMC card slot, antenna for clear radio reception. All these are optional.

Connection diagram
USB MP3 connection diagram

The connection diagram doesn’t show how to connect an SD/MMC card socket. You can connect the SD/MMC to this player using an USB card reader.

Be careful while connecting the USB socket. If there is a connection mistake, it can damage your flash drive. Cross check the connection with the below image.
USB connector

Bill of Materials
MP3 Player board + Remote Controller
USB socket
3.5mm stereo jack
IR sensor (3.3v)
5V power supply
Switches (optional)
SD/MMC card socket (optional)

NOTE: This is not an open Hardware project because the circuit diagram and PCB layout is not available from the vendor 🙁

Posted in: Circuit, Electronics, Hacking | Tagged under: , , , , | 57 Comments

USB MP3 Player


Last day I bought a USB MP3 player board from a local store in Thrissur. This board can read MP3 files from a USB thumb drive and play it for you.

The board circuit diagram is so simple that there are a very few connections. some of the connections are

The other main features are an built in FM receiver and also an remote control. The player can read up to 1999 songs. I have not tried any other music formats other than MP3.

The main attraction is its cost. The board cost only 250 Rupees ( 5$).

Here is the connection diagram details.
http://jeffrey.co.in/blog/2010/10/usb-mp3-player-connection-diagram/

Here are some screen shots

Note(Nov 28, 2009): This is not an open hardware project. Please don’t ask for circuit diagram. I actually bought this circuit board from a local store. The connection details are so easy. The board has markings on it for the connections.

Posted in: Circuit, Electronics | Tagged under: , , , | 198 Comments