Learn JTAG By Writing A Bit-banging Programmer

j-tag-flow-chart

[Pesco] won one of Dangerous Prototypes’ PCB giveaways a few months ago. He opted for a CPLD breakout board. He just needed to put in a parts order and populate the components himself. But then what? He needed a JTAG programmer to work with the chip. Like any good autodidact he choose to make his own rather than buying one. He absorbed the JTAG specification and coded a bit banging programmer using an Arduino.

We’ve used JTAG many times to program ARM chips. But until now we never took the time to figure out how the specification works. If you’ve got an IEEE subscription you can download the whitepaper, but [Pesco] was also able to find one floating around on the interwebs. The flow chart on the left is the cheat sheet he put together based on his readings. From there he wrote the Arduino sketch which implements the programming standard, allowing him to interact with a chip through a minicom terminal window.

[via Dangerous Prototypes]

Evalbot As A JTAG Programmer

evalbot-as-jtag-programmer

[Adarsh] needed a JTAG programmer to push code to a CPLD dev board he was working with. He knew he didn’t have a dedicated programmer but figured he could come up with something. Pictured above is his hack to use a Stellaris Evalbot as a programmer.

Long time readers will remember the Evalbot coupon code debacle of 2010. The kits were being offered with a $125 discount as part of a conference. We were tipped off about the code not know its restrictions, and the rest is history. We figure there’s a number of readers who have one collecting dust (except for people like [Adam] that used it as a webserver). Here’s your chance to pull it out again and have some fun.

A bit of soldering to test points on the board is all it takes. The connections are made on the J4 footprint which is an unpopulated ICDI header. On the software side [Adarsh] used OpenOCD with stock configuration and board files (specifics in his writeup) to connect to the white CPLD board using JTAG.

Rolling Your Own Minimal USB To Serial Arduino Programmer

usb-to-serial-programmer

[Hans Peter] wanted to move away from using full Arduino boards in his projects. One of the components he rarely used after the development stage is the USB hardware. Once the firmware is flashed to the chip he didn’t need it any longer. So he tried his hand with some really small SMD parts by building this USB to serial Arduino programmer.

The chip he went with isn’t the FTDI part we’re used to. Instead of using an FT232RL, he opted for its smaller cousin the FT230x. This chip doesn’t fully implement the communications protocol of the 232, but it does work with AVRdude and that’s all that really matters. Above you can see [Hans’] creation next to the official Arduino USB-to-serial programmer. He used the same connection scheme, but went with an edge connector for the USB instead of using a mini-B jack.

It’s pretty impressive to see his prototyping work with the 16-pin QFN package. He soldered it dead-bug style to a couple of SIL pin headers in order to test it on a breadboard. The first board he assembled was too loose in the USB port, but he added some tape to the back to make it thicker, and coated the edge connector traces with a bit of solder and that did the trick.

Add Features (that Should Have Already Been There) To An EPROM Programmer

extending-an-eprom-programmer

[Morten Overgaard Hansen] has a cheap EPROM programmer which he uses to program chips for retro gaming (among other things). He was surprised that although the device includes a 40-pin ZIF socket it seems to lack the ability to program 16-bit chips. He figured he could get it to play ball if he put in a little effort. Above you can see that a few add-on parts enabled 16-bit programming on the device.

If you look inside the case you may be surprised to find it uses an FPGA. [Morten] searched around and found a few others online who had been looking to stretch the functionality of these types of programmer. Specifically, he came across a Python program for this programmer’s bigger bother that already implemented the functions necessary to program the larger chips. He used it as a guide when writing his own programming application.

On the hardware side of things he needed to feed a higher voltage to the VCC pin, which is done with the boost converter seen to the right. He also added some jumper wires to manage the output enable signal. To make the whole thing modular he ordered a ZIF socket with long pins and soldered the alterations in place. Look closely and you’ll see two levers for ZIF sockets. The one on the right is for the original socket, the one on the left is for the adapter.

Genetic Algorithms Become Programmers Themselves

AI

[Kory] has been experimenting with genetic algorithms. Normally we’d expect his experiments to deal with tuning the variables in a control system or something, but he’s doing something much cooler. [Kory] is using genetic algorithms to write computer programs, and in the process bringing us one step closer to the Singularity.

The first experiments with genetic algorithms generating applications did so in BASIC, C, and other human-readable languages. While these programs nearly worked, there were far too many limitations on what could be produced with a GA. A simpler language was needed, and after turning to assembly for a hot second, [Kory] ended up using brainfuck, an extremely minimal but still Turing-complete language.

The use of brainfuck for creating programs from a genetic algorithm may seem a bit strange, but there’s a method to [Kory]’s madness. It’s relatively simple to write an interpreter the GA’s fitness function can look into and come up with a score of which programs should breed and which should die. Also, the simplicity of brainfuck means a computer doesn’t have to learn much syntax and grammar at all.

Right now, [Kory]’s computer that can program itself only does so by creating simple ‘hello world’ programs. It should be possible, though, for this AI to create programs that take user input and generate an output, whatever that may be. Once [Kory] is able to have the computer generate its own fitness functions, though, the sky is the limit and the Singularity will be fast approaching.

USB Keyboard Becomes An AVR Programmer

[Steve] created an AVR programmer using an old USB keyboard. We feature a bunch of AVR programmers, but this one is made from parts that many people will have lying around. There are two components: the controller PCB from a USB keyboard, and an optocoupler for emulating key presses.

In order to send data to the AVR, [Steve] used the LED outputs on the keyboard. These LEDs can easily be toggled according to the HID device specification. They provide a 5 volt output with current limiting resistors, which means they can be connected directly to the target AVR.

Reading data is a bit more complex. The optocoupler tricks the keyboard into believing that a single key has been pressed, firing off a data transfer. The MISO pin on the AVR is connected to the row and column of the shift key, which is read by the driver.

On the software side [Steve] created an avrdude interface driver. This allows the programmer to be used with avrdude, just like any other programmer. [Steve] does point out that it isn’t the fastest programmer since the keyboard tries to debounce the MISO input, greatly limiting the speed. However, since it’s made from stuff you might have in your junk bin, it’s a neat hack.

Help Create A Universal ARM Programmer

The new crop of ARM Cortex M0/M3/M4 microcontrollers have a lot of interesting features for developers. In addition to supporting drag and drop programming via USB, the same hardware can also be used as a debugger. Setting breakpoints and inspecting memory at any point in the code is a wonderful feature, but not all the new ARM dev boards we’ve seen support this feature.

The folks over on SimpleCortex have a solution to this problem, but they need your help. To get their CMSIS-DAP hardware working with Open Source tools, they’re looking for a few good programmers and hardware developers to build a toolchain.

Right now, the hardware only works with Keil development tools. A closed source development environment is no good to anyone, so if you have some experience writing drivers and such, send the guys at SimpleCortex an email. They’ll give you a free board in return for a contribution to building an open source ARM toolchain.

Common sense requires us to mention that you should probably only send these guys an email if you actually plan on working on this problem. Still, it’s a great opportunity to contribute to open hardware.