Showing posts with label msp430. Show all posts
Showing posts with label msp430. Show all posts

Friday, 2 August 2013

Meet the Goodfet v42

The Goodfet is a super versatile tool for debugging and programming.

Once you received your pcb from Trevor you practically only need two integrated circuits and few passives.
The FT232 ic is responsible for usb to serial communication and the MSP430F2618 is the "brain" of the tool.

When the build is completed, simply  plug the Goodfet into a free usb port.
Open a console and enter dmesg to find out where the Goodfet is attached to.

> demesg

[ 4225.304042] usb 2-3: new full-speed USB device number 31 using ohci_hcd
[ 4225.610251] ftdi_sio 2-3:1.0: FTDI USB Serial Device converter detected
[ 4225.610327] usb 2-3: Detected FT232RL
[ 4225.610333] usb 2-3: Number of endpoints 2
[ 4225.610339] usb 2-3: Endpoint 1 MaxPacketSize 64
[ 4225.610344] usb 2-3: Endpoint 2 MaxPacketSize 64
[ 4225.610349] usb 2-3: Setting MaxPacketSize 64
[ 4225.623183] usb 2-3: FTDI USB Serial Device converter now attached to ttyUSB0

In this case it is ttyUSB0

Then edit your environment file and add the following lines:

> nano dev/environment

export board=goodfet42
export GOODFET=/dev/ttyUSB0 

 
The next step is to save your info file (important!) because after programming it is 
gone.
 
> board=goodfet42 goodfet.bsl --dumpinfo >info.txt
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)

 
This is what my info.txt file looks like
 
> nano info.txt
 
@1000
aa 55 ff 3f cd ab aa 55 34 12 ff ff aa 55 ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff 8b 86 fe 16 ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff 08 10 00 80 01 00 d0 81 ba 0b da 0d 04 82 05 07 
4c 08 fe 08 ff ff ff ff ff ff ff ff 01 08 9a 8f a2 8e 95 8d d2 86 
q
 
 
Next step program the newest firmware to the device
  
 
> board=goodfet42 goodfet.bsl --fromweb
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Checking for info flash...  Saved!
Grabbing goodfet42 firmware from http://goodfet.sourceforge.net/dist/goodfet42.hex
Failed to run curl, trying wget
2013-08-01 09:46:07 URL:http://goodfet.sourceforge.net/dist/goodfet42.hex [55933/55933] -> "/tmp/.goodfet42.hex" [1]
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Program ...
19870 bytes programmed.
Programming info flash...

 
I also programmed the install info created from the info file, tough I am nut sure this step 
is necessary.
 
> board=goodfet42  make installinfo
goodfet.bsl --speed=38400 -P goodfet.hex -p info.txt || true  #MSP430F2xx targets only, inelegant.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Program ...
256 bytes programmed. 

 
Programming is now completed and you should now own a working Goodfet tool.
To be on the safe side lets invoke a self test.

 
>board=goodfet42  goodfet.monitor test
Performing monitor self-test.
Self-test complete. 
 
Great a new working Goodfet tool is born.
To see what this tool is capable of lets enter
 

> board=goodfet42  goodfet.monitor listapps full
 
GoodFET with f26f MCU
Clocked at 0x8f9a
Build Date: 2013-01-23 16:28
Firmware apps:
Monitor
    The monitor app handles basic operations on the MSP430
    such as peeking and poking memory, calling functions and
    managing the baud rate.

SPI
    The SPI app handles the SPI bus protocol, turning
    your GoodFET into a USB-to-SPI adapter.

MAXUSB
    This allows you to write USB Host or USB Device drivers for
     the MAX3421 and MAX3420 chips.

JTAG
    The JTAG app handles basic JTAG operations such as
    resetting the TAP, resetting the target, detecting
    the instruction register width, shifting bits into
    both the instruction and data registers.

JTAG430
    The JTAG430 app adds to the basic JTAG app
    support for JTAG'ing MSP430 devices.

JTAG430
    The JTAG430 app adds to the basic JTAG app
    support for JTAG'ing MSP430 devices.

JTAG430X2
    The JTAG430X2 app extends the basic JTAG app with support
    for 20-bit MSP430X2 devices, such as the MSP430F5xx Family.

JTAGARM7
    The JTAGARM7 app extends the basic JTAG app with support
    for JTAG'ing ARM7TDMI based devices.

OpenOCD
    The OpenOCD app handles the OpenOCD bitbang protocol.

CHIPCON
    The CHIPCON app adds support for debugging the chipcon
    8051 processor.

AVR
    The AVR app adds support for debugging AVR based devices.

NRF
    The NRF app adds support for the NordicRF register
    interface.
 
 


If that is not a powerful tool I don't know what is.
I will add some future blogs showing in detail how to use this swiss army knife of 
programmers debuggers and tools. 
 
Goodfet42 and Goodfet41
 
 
Links:
Goodfet42 


Thursday, 1 August 2013

Goodfet hardware developing tools

Trevor Goodspeed is an amazing hacker and hardware designer.

In the moment there are three pcbs available.

First the Goodfet Trevor's signature module.

The GoodFET is a JTAG adapter,  based upon Texas Instruments MSP430 FET UIF
The Goodfet can not only be used as a programmer, but also as an universal serial bus interface.

Second the GoodThopter

The GoodThopteris an opensource Can bus monitor.
The main purpose of this board is to explore Automotive communication buses, currently supporting only the CAN bus. In addition to the Goodfet a high-speed CAN Transceiver and a Stand-alone CAN Controller with a SPI Interface was added. The GoodThopter also allows users to purchase the cheaper OBD2 cables from SparkFun.

And third the Facedancer

The Facedancer is a hardware revision of the GoodFET except unlike the general-purpose GoodFET boards, the only purpose of this board is to allow USB devices to be written in host-side Python, so that one workstation can test the USB device drivers of another host.

I received pcbs from the above modules and will post a more detailed blog entry for each of them soon.



Trevors hardware and software are available under the BSD license, and free-as-in-beer boards will be given to those who ask politely.

Goodthopter Facedancer and Goodfet pcbs


Links:
Goodfet further information
Goodfet Homepage
GoodThopter Homepage
Facedancer Homepage
Ordering blank pcbs 

Thursday, 25 July 2013

GPS Locator

I often read about new Gps receiver which are so sensitive the even get a lock indoors.
Every now and then I believe this rumours buy the unit try it at home and of course it does not receive enough satellites to get a lock sometimes it does not even receive one.

A gps receiver at would be grat, I could synchronise my Rubidium oscillator with the 1pps output, or build a timeserver ,...

 The MTK3339 Gps receiver I tested has a pretty fast fix and there is a breakout pad available which fits on the Launchpad. There is even the option to connect a battery to it so it does not lose its satellite data and only needs a warm start.

When you remove the target processor on it you can use the Launchpad as serial to usb converter.
So you plug the Gps pcb on the Launchpad, start a terminal programm on the Pc and watch the Gps data flow.

Unfortunately no Gps lock at home, but nevertheless a very sensitive and fast Gps receiver.

Gps Locator pcb

Gps Locator bottom view

Links:
Booster Pack shop link
Gps receiver

Wednesday, 24 July 2013

Nokia 5110 Msp430 Booster Pack

Texas instruments is becoming my most used development platform.
The launchpad series is great for rapid development and did I mention the debugger is great ?
Since Ti is such a big company it is somewhat hard to gather the information you need, since they have many technical writers and thousands of documents. They also lack some kind of easy tutorial which just gets you started like the one from Embedded Artists for the Nxp line or I simply have not found it yet.

Edit:
Unbelievable there is a great tutorial site from Ti I just found it within minutes after I wrote this blog,...
http://processors.wiki.ti.com/index.php/Getting_Started_with_the_MSP430_LaunchPad_Workshop



On the other hand there is a great user community and if you have some experience with other controllers you will get used to the controller line soon.

The Nokia booster pack is designed by RobG and it is also possible to build it as a  stand alone display.
I decided to do so, but I had great difficulties to get the programmer to recognize the board.
In the end my reset controller consisting of an resistor and a capacity did not work out. After hours of head scratching guess work I removed the capacity and it did work immediately, very strange.
To program the controller I simply put the board on a launchpad with empty target controller socket.

I tried some example code from the designer and the booster pack worked great.

I usually don't like displays without a character generator,  but once you defined the character set you won't notice a difference, so no problem whatsoever.

The Nokia 5110 display is controlled via Spi bus, so update rates are fast and programming is easy once you get used to the concept. There is a nice lecture from Cornell university which helps you understand the basic concepts to use a Spi bus.

Btw. I decided to build a standalone version, because I can implement a full blown easy to use display controller module and then simply connect any circuit to it to use it, even the interface choice is flexible, from simple bit bang mode to serial or I2C anything is possible. I simply like modular approaches.

Finally some pictures:

Nokia 5110 msp430 booster pack

Bottom side

In action

On top of the launchpad to program the controller


Links:
Spi tutorial
Buy pcb from 43oh shop
Build thread

Tuesday, 23 July 2013

WS2812 RGB Led Matrix Booster Pack

The WS2812 is a highly interesting RGB led, since it already has a controller build in and supports daisy chaining.

Now how does it work ?
You can send 3 bytes of information to the led. Every byte corresponds to either the intensity of the colour red green or blue. 255 translates to highest intensity while 0 turns the corresponding colour of.
So f.e. you have 10 leds in a row and send 30 bytes to them. The first led grabs the first 3 bytes and passes the left 27 bytes down to the other leds. But the led not only passes the bytes down, it also reshapes the signal and amplifies it.. You don't need to worry of signal integrity.

The controller also only needs one data line, so there is no clock signal needed.

There is only one problem, the signal has to be short to get reasonable update rates.
So a 1 is translated to a 1.2us long high impulse followed by a 1.3us long low impulse.
While a 0 is translated to a 0.5us long high impulse followed by a 2. us long low impulse.

So the pulses need to be so fast you cannot bit bang them any more you need a built in hardware module.
Some genius developer on the internet suggested to use the built in Spi bus protocol since it supports fast data rates.But there are still some problems waiting to be solved. In hardware Spi a bit always has the same time frame and either a high or a low pulse.

So you have to map your bit to a matching spi sequence.
So first program the bus speed to 2 mhz. Every bit is now 0,5 us long.
A bit with value 1 now translates roughly into 11000
A bit with value 0 translates exactly into 10000

The bit with the value 1 is not exactly mapped but the processor has a tolerance of +-150 nS so we should be fine.

I tested the code with a WS2812 led light strip I built and it worked.

This is a great example of a developers ingenuity, there is a big problem but thinking out of the box and using an hardware bus protocol which has completely different specs but is fast enough saved the day.

I plan to use the led matrix  as a moodlight, but most importantly I wanted to learn how to use this leds.
I want to use them to display sensor data like temperature and humidity. Blue would translate to below comfortable, green ok and red above comfortable level.

RobG Led Matrix Msp430 Booster Pack


Backside JP1 powers module from launchpad

Booster pack in action
 Links:
Buy pcb
Designers forum thread

Friday, 12 July 2013

How to solder QFN chips like the MSP430FR5739

The new MSP430FR chip line has interesting features like embedded non volatile fram and ultra low power consumption. The chip is available in TSSOP38 or QFN40 package.I simply had to try them out.

Usually hobbyists  are repelled by the very small case and the missing pins.
But once you get used to work with the QFN package you start to prefer it over any other packaging.
Since they have no visible pins, they cannot suck the solder up via capillary suction and create ugly shorts.

To solder a qfn chip you buy a breakout board and put a small amount of solder paste at the pcb.
Beside the solder paste you add some solder flux (very important).
Then you place the chip on the board and roughly align it.
With an heat gun you slowly heat the chip and board until the flux starts to melt.
This is a very important phase because the chip will swim on the fluid and align itself correctly.
Now heat it up until the solder past melts and you are done.

The next problem you will face is how to check the correct alignment and if all pins are correctly connected to the board.I use a multimeter for that purpose. Usually the pins have a certain resistance around 5k to 1mega ohm. Measure all pins and if there are shorts suck them away using some solder wick.

Once you get used to Qfn packages and are able to solder the chip  correctly it will only require about two minutes of your precious spare time. Soon you will start to enjoy working with Qfn packages.

MSP430 in QFN package compared to a Dil20 chip

Links
MSP430FR5739
Fram
Demo video

Thursday, 11 July 2013

Meet the Powerscope

Since Ti announced the Launchpad I was very excited to play with this awesome development tool.
It is like a Arduino on steroids, mostly because of it's 16 bit capability and most important it has a debugger.
When your code does not work nothing is more useful than a debugger, maybe  with the exception of a razor sharp brain and years of development experience might not hurt either.

Since the Msp430 line supports low energy consumption and have many different feature sets it is important to verify if the consumption is really as good as it could be. To see exactly what is going on, a scope is the tool of choice, but for a quick estimation the Powerscope is much more comfortable and easier to use.

When measuring very low power devices I would not recommend to use a multimeter, because of their usualy high burden voltage. To circumvent this problem, David Jones from EEVBlog designed the uCurrent , also a great tool.
The Superprobe is a somehow similar device, but it has it's own display so you don't need to connect it to a multimeter.

I also built an usb adapter to attach the Powerscope to a Usb device and measure it's power consumption.
In the attached example pictures I connected the Powersope to an Launchpad which drove a CC2500 radio device.It does not make much sense, because the attached debugger also has a unknown power consumption but it gives an idea of usage and it also shows that the TX mode consumes about 17 mA more than the RX mode .Btw. the code in the moment has no power optimisations what so ever, I was more than happy to get the CC2500 up and running,...

The programming of the Powerscope also was more than easy.
You can either use the Launchpads programmer by removing all the jumpers and insert a programmer cable or you can like me use a Goodfet programmer designed by Travis Goodspeed.
Since I don't like to solder headers just for one time programming, I made a small programming cable with pogo pins. You can use this kind of connection even for debugging.

You can buy an empty pcb at the 43oh store.

Powerscope front side


Powerscope back side

Powerscope connected to Lauchpad in TX mode

Powerscope connected to Launchpad in RX mode

Goodfet 4_1 programmer and programming cable with pogo pins


Links:

Buy Powerscope pcb
Designer thread
Powerscope Code and Info page
Goodfet programmer