Saturday, 3 August 2013

Texas Instruments CC Debugger

Texas Instruments offers great tools to get you started on their zigbee like wireless transceiver line.
CC Debugger and Smart RF studio.
You can buy a CC debugger for about 48$ at the Ti webshop, but where is the fun in that?
Luckily Ti provides the schema files , boot loader and firmware for the CCDebugger, so you easily can build one yourself.
I even found the gerber files for the product on the internet and ordered a batch of 10 pcbs from Itead.
I don't need them all, but this is their minimum order size.

What can you do with this tool?
The debugger helps you to evaluate signal strength , configuring the wireless modules and explore different configurations.
The modern Zigbee devices are incredibly powerful cheap but also very complicated.
A tool which helps you getting started is most welcome. 

The build of the toll was not really challenging but the programming gave me headaches for a while.
After I soldered the components to the pcb, I plugged the board into an usb slot.
Both leds lid up which means according to the manual empty controller.
So I had to load the boot loader into the CC2511 controller chip.
To do so you either need a  (programmed) CC Debugger or some fancy expensive dev board from Ti .
Luckily I own a Goodfet tool.

I fired up the console and connected the CC Debugger to the Goodfet.
The first step is to check if the programmer recognises the module 

> goodfet.cc test


SmartRF not found for chip 0x9104.
Tracing execution at startup.
Verifying that debugging a NOP doesn't affect the PC.
Checking pokes to XRAM.
Done.

Great, success.
Next step programming the bootloader




> goodfet.cc flash ../../../../usb_bootloader_srf05dbg.hex

SmartRF not found for chip 0x9104.
Flashing ../../../../usb_bootloader_srf05dbg.hex
Buffering 0000 toward 000000
Buffering 0100 toward 000000
Buffering 0200 toward 000000
Buffering 0300 toward 000000
Flashing buffer to 0x000000
Flashed page at 000000
Buffering 0400 toward 000400
Buffering 0500 toward 000400
Buffering 0600 toward 000400
Buffering 0700 toward 000400
Flashing buffer to 0x000400
Flashed page at 000400
.....
Flashed page at 001000
Buffering 1400 toward 001400
Buffering 1500 toward 001400
Flashing buffer to 0x001400
Flashed final page at 001400

Done, the rest is easy.
Start Smart RF Studio from Ti , plug in the CC Debugger and Smert RF Studio will program the device for you. Great!!!

Figuring out how to program the device took me a while, I even killed one CC2511 but once you figured it out all becomes so easy,...
Debugging the chips using the Goodfet is also possible, but Smart Rf Studio is way simpler and has a Gui.
I admit I am lazy,...

CCDebugger board top side
CCDebugger board bottom side


Links:
CC Debugger
Smart RF Studio
Goodfet

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 

Wednesday, 31 July 2013

Complex Programmable Logical Devices

I already gave an small introduction about CPLDs in part III of the 3 Ghz counter build.
Cplds and Fpgas are very interesting devices for those who ever wanted to design their own integrated circuit but could not afford a million $ to let your prototype actually build.

A Cpld consists of the following elements:
Programmable And/Or matrices the macro cells
Programmable feedback
Input blocks
Output blocks

They distinguish themselves primarily in speed and the amount of programmable cells and pin count .
Unfortunately if you need many programmable macro cells the designers assumed you probably need many in out pins too. But many in out pins mean very small footprint and very home brew unfriendly.

So the hobby engineer is restricted to low cell count packages and therefore only small designs.

What are the advantages of a Cpld over a micro controller.
A Cpld can work massively parallel a  lightning speed.
The I/Os don't need a higher level control structure they work just by the logic assigned between an input and an output. They are often used for data capturing and collecting then they transfer the data to a high speed ram and then a micro controller  analyzes the data. Fast oscilloscopes would be unthinkable without high speed logic, micro controllers are ridiculously slow compared to Fpgas.

How to get started ?
Unfortunately programming and designing code for Cplds is completely different to program a micro controller and full of pitfalls.So the best way is to start small and use a simple low cell count target chip.
This is where Dangerous prototypes comes in, they designed two breakout boards based on the Coolrunner II series.One has a macro cell count of 72 and the other of 64.So you wont be able to run an Arm chip design on them but you could use them as multiplexer, inverter, ... You could reproduce the basic logic design blocks with them and combinations of them. You also get used to Verilog the programming language.
Later one if you decided you like the environment you could easily transit to the bigger high cell count Cplds.

To get started I would suggest the CoolRunner II XC2C64A CPLD with 64 macro cells and an Altera Usb Blaster programmer clone from Ebay.

As a first step I would work trough the Dangerous Prototypes tutorial section.

Cpld devboard and programmer



Links:
Dangerous Prototypes Cpld Board
Cpld Forum
Tutorials

Tuesday, 30 July 2013

Arduino Video Overlay Shield

In 2011 I won a free pcb from Dangerous Prototypes, a Arduino shield you can use to overlay and display data on a video stream.

The Arduino Video Overlay Shield is based on the MAX7456 on screen display chip.
The Arduino compatible shield board overlays text on analog video, therefore
it allows easy overlay of text onto an analog video signal, NTSC or PAL.
Just plug it on an Arduino processor board to get started.
The shield is created by Lowvoltage Labs.

 I wanted to use it to display the subject line and address  of incoming emails while watching tv.
Another use could be a osd system to display flight data on rc planes.

Unfortunately the board needed a 27 Mhz crystal and I could not get my hands on one.
As soon I got one I could not find the board anymore,...
Meanwhile I found it and finally assembled it. The board worked out of the box, except the processors character set is Japanese by default! Luckily I could find a European standard Ascii character set and some code to upload it. The character set text file size is 170 kB and the upload took about three minutes.

Now the hello world output does not look so strange anymore.
A fine board and a interesting new chip, what could you possibly ask for more ?

One final but important note, do not forget to insulate the osd output plug, because it will most certainly short out on the Arduino Usb plug.

Osd shield ready for action
Osd shield top side
Osd shield bottom side, please do not forget the insulation on the video out side plug
Hello world test osd over webcam input


Links:
Dangerous Prototypes Video Shield Announcement
Lowvoltage Labs
Seeedstudio sells assembeled boards
MAX7456 datasheet
Wiki entry
Arduino forum thread

Monday, 29 July 2013

3 Ghz counter and power detector build Part IV Putting the counter into service

After I had soldered the remaining parts like missing passives the lcd display and user buttons the build process was finished.
Before applying power I measured the resistance of the power lines  and some other important points to ensure there are no nasty shorts hiding somewhere.

The big moment applying power.
Nothing except a short blink of the lcd back light happened .
Hmmm
Soon I figured out there is a very nice software power switch  implemented.
You need to press the ok button to switch the unit on.
Very nice, I will implement that logic in my own designs too.
Power switches are so outdated.

So the unit works. As a first test I measured the power and frequency of an fm test generator.
Without calibration the frequency part worked ok but the power measurement was of by 3 db.
To calibrate the unit I need access to the university test lab, which I don't have until September.

First impressions, pros and cons of the unit:

Pros:
Very nice power on design
Usage of qfn components I lover to solder fine pitched smd devices
Cpld design
Open source software for the microchip and the cpld

Cons:
A usb port to export data is missing
The displayed frequency is always drifting
No gate time setting
Silk screen of pcb is horrible , very fuzzy and partly unreadable (the manufacturer promised to take care of this problem though)

In the end I am unfortunately disappointed of the unit.
On the other hand it still will be a help in the spectrum analyzer build process.
I am also thinking about implementing an serial output.
To log the data in a computer could be a big help. You could for example plot the frequency versus power output of a device and visualize the stability of the power in a given range.

Finally the counter in action (Please excuse the flare on the lcd)


Links:
3 Ghz counter and power detector build Part I
3 Ghz counter and power detector build Part II
3 Ghz counter and power detector build Part III
Elektor project page


Sunday, 28 July 2013

3 Ghz counter and power detector build Part III Cpld

The counter not only has a Dsp that needs programming, there is also a Cpld.
Cplds (Complex Programmable Logical Devices ) are very interesting parts.
A Cpld gives you the possibility to create your own integrated circuit.
In a very simplified explanation I would say they are made of thousands of gate arrays and configurable wires which connect between the gates and the pins.
Programming a Cpld is more like routing a pcb than programming a microcontroller.
A common language to describe your circuit is VHDL (Verilog Hardware Definition Language).

Cplds and Fpga (Field Programmable Gate Array) are very powerfull devices.
They can process tasks massively parallel are very fast but also expensive and tricky to program.

Programming a Cpld is usually done via Jtag interface.
I downloaded the Altera programmer and used a 5$ Jtag programmer clone of the Altera Usb Blaster.

Everything worked immediately .
The last step of the counter build is to add the rest of the passive components.

Successful programming of the Cpld
Links:
3 Ghz counter and power detector build Part I
3 Ghz counter and power detector build Part II
Elektor project page
Altera Homepage