All posts by Stijn Kuipers

Programming interface progress: SWD JTAG command sequences

by Stijn Kuipers

Since the last post I spent quite some time with my new tool to dump sequences from my commercial debugger. After comparing these dumps to various codebases I found online (libswd, cmsis-dap, mchck) and comparing them to the various manuals on the subject, I managed to extract the command sets for a set of essential functions:

1) Peek/Poke (universal to all ARM cores)
2) Halt/Continue (universal to all ARM cores)
3) Reset (Freescale specific)
4) Mass erase (Freescale specific)

With these command sets figured out, I was able to recreate them on a standard Arduino and trigger them with a simple serial remote control application. I also managed to figure out how, when and why all the various types of registers are available to read/write over the debug lines. In the case of the Freescale chips I’m targeting, some features are only available after setting certain bits somewhere else. Others only work when the system resetpin is activated. Joy.

Example: reading the identification register to see if the chip has powered up correctly. The magic value here is the 0x04770031 at the end.

bits

Figuring all this out has brought me much further along the path – I am now almost ready to start executing flash commands on the target device. When the system can flash the MKL26 and MKL02 chips I am planning to move the codebase from the Arduino it lives on now to a set of dedicated small/cheap boards. One of these will be another USB-stick type PCB (plugs straight in to a USB port) with a simple row of programming pins meant to program microgameboys – possibly pogopin holder.

Still to be continued…

Reverse engineering SWD JTAG debugging/flashing protocol for Freescale chips

by Stijn Kuipers

One of the great breakthroughs of the Arduino has been that to get started, you only need the device itself and the software. The try/fail/try again cycle of development got reduced to altering your code and pressing run (again).

Most other platforms completely fail in this respect. Many chip-manufacturers have excellent and cheap try-out boards that are even pin compatible with the Arduino. However, while Arduino gets many things right – hardware choices and software choices are not two of them. The Atmel AVR series is easy but outdated. The Arduino “IDE” barely beats notepad.exe in functionality and project management.

Chip manufacturers almost invariably fail to recognize that having to struggle through ANYTHING between the compile button and the thing actually running your code is losing them enthusiasm, mindshare and ultimately customers. Because the manufacturers have no idea how to approach this part of the developer experience themselves, and apparently no inclination to get involved, they attempt to extend the Eclipse IDE (with endless pages of settings tabs) or try to become hardware compatible with Arduino.

So when I was recently asked if I would like to host a workshop programming games for the latest incarnation of the microgameboy, I had a problem! There is no real foolproof way to even talk to these chips! The official toolchain only supports a handful of programmer devices you have to attach separately using a tiny halfpitch connector that is not easy to find. This will not do for novices.

So part of my “this really should NOT be Rocket Science” quest has become this:

Make developing for a platform like the microgameboy EASY.

Stage one: creating a cheap tool to connect the microgameboy to your pc to update the program memory.

The chip I am using in the microgameboy is made by Freescale (the MKL02Z32 to be precise). This chip belongs to the ARM Cortex M0 family of devices. ARM is a big company that creates standard designs for chips. If you keep to the standard, software written for that standard will run on your device. Luckily, the Cortex standard includes a chapter on the debugging interface. The debugging interface allows anyone to inspect the inner state of the chip and poke around in its system memory. With some clever mangling (and the manual from Freescale – since this bit is outside the Cortex standard) you can trick the chip into updating/rewriting its own flash memory. This is what I’m going to do.

The first step of such an undertaking is (as usual): Homework.

Serial Wire Debug manual by ARM

“DAP Lite” manual by ARM

KL26 manual by Freescale
There are endless stacks of documents to be found that all refer to the debug interface in some way or other.. which always leads me to:

The second step of such an undertaking is (as usual): screw this shit..

I am not going to sit here reading 5000 pages of dense text. I’ll have a look at the actual data instead.

Last year I ordered a whole bunch of tools to deal with inspection of electrical signals. Amongst this set is an Open Workbench Logic Analyzer by GadgetFactory. It allows you to record a whole bunch of signals at the same time, at very high speeds. Using this device, I got this:

2015-02-02-0219 - Logic capture of the init sequence made by jlink

Saving this to a file and parsing the file for clock/data state transitions got me this huge array of bits:

data dump from jlink capture:

As you can see, the file contains some obvious patterns, creating diagonal lines in the data dump like 60’s wallpaper. By pressing enter at the diagonals, I separated the data dump into a more logical grouping of bits.

Spacing it better

111111111111111111111111111111111
11111111111111111111111011110011110011111111111
11111111111111111111111111111111111111111111111
10110110110110111111111111111111111111111111111
11111111111111111111111111000000000000000010100
10110011101110001010001000001111010000000001010
01011001110111000101000100000111101000001010000
00110011011110000000000000000000000000000000000
01001010110011000000000000000000000000000010100
00000001011000110000000010000000000000000000001
11111010001101100110000111100000000000000000000
00000000000011111001100000000000000000000000000
00000000010111011011001000110000000000111011100
01000000101011110110011000000000001000000000000
00111111010001101100110000000000000000000000000
00000000000000011000101100110100100000000000000
00000110001001000000011010001100110000000000000
10000000000000011111000000011111001100000000000
00000000000000000000000010111101011001100000000
00011111111111111111111101101000110011000011111
11100000000000000001111000000001111100110000000
00000000000000000000000000001011111001100101100
00000000000000000000000000110111110011000000100
10000000000000000000000000101111100110010100000
00000000000000000000000001011110101100100011010
00000000000000000000000010110100011001100100000
00000100000000000000111100000000111110011000000
00000000000000000000000000000101111010110011000
00000001111111111111111111101011010001100110000
11111111100000000000000011111000000011111001100
00000000000000000000000000000000010111110011001
01100000000000000000000000000001101111100110000
00100100000000000000000000000001011111001100101
00000000000000000000000000000010111101011001000
11010000000000000000000000000101101000110011000
10000000001000000000000001111000000001111100110
00000000000000000000000000000000001011110101100
11000000000010111111000000001111110101001011001
11011100010100010000011110100000101000000110011
01111000000000000000000000000000000000001001010
11001100000000000000000000000000001010000000001
01100011000000001000000000000000000000111111010
00110110011000000000000000000000000000000000000
00001100010110011010000000000000000000000110001
00000000001101000110011000000001011011100000000
00000111100000001111100110000000000000000000000
00000000000001010111101100000000000110001100110
00010000010010110100011001100110000101101110000
00000000011110000000111110011000000000000000000
00000000000000000101011110110000000000000000001
01000000101111101010000001100110111100000000000
00000000000000000001000110110011000000000000000
00000000000000000011010001100110000000000000100
00000000000001110110001011001101001000000000000
00000001100010011101110110011010000000000000000
00000000000000100000000101111011000000000000000
00000000000000000000101000000110011011110000000
00000000000000000000000100011011001100000000000
00000000000000000000001101000110011000011111011
01110000000000000111111000101100110100100000000
00000000000110001001111110011000000000000000000
00000000000000000101011110110010000000000000000
00000001000000001010000001100110111100000000000
00000000000000000001000110110011000000000000000
00000000000000000011010001100110000000000000100
00000000000001110110001011001101001000000000000
00000001100010011111100110000000000000000000000
00000000000001010111101100000001000000000000000
00000000000110100000011001101111000000000000000
00000000000000010001101100110000000000000000000
00000000000000110100011001100111111101101110000
00000000011111100010110011010010000000000000000
00011000100111111001100000000000000000000000000
00000000010101111011000000000000000000000000001
00000001101000000110011011110000000000000000000
00000000000100011011001100000000000000000000000
00000000001101000110011000000000000100000000000
00000111011000101100110100100000000000000000001
10001001111110011000000000000000000000000000000
00000101011110110000000000000000000000000000000
10011010000001100110111100000000000000000000000
00000001000110110011000000000000000000000000000
00000011010001100110000000000001000000000000000
01110110001011001101001000000000000000000011000
10011101110110011100000000000000000000000000001
00000000000101111011000000000000000000000000000
00000000101000000110011011110000000000000000000
00000000000100011011001100000000000000000000000
00000000001101000110011000110000000111111110000
00000111111000101100110100100000000000000000001
10001001111110011000000000000000000000000000000
00000101011110110000000000000000000000000000000
00001010100101100111011100010100010000011110100
00010100000011001101111000000000000000000000000
0

Almost repetitive, I did not manage to create a straight line but again revealed a pattern in the data. I remembered reading about the packet layout somewhere on the first pages of the manuals. The packets should be 8bit – pause – 3bit – optional pause – 33 bit – optional pause. Let’s see how that fits the data:

Syncing it up

10100101 100 11101110001010001000001111010000 0
10100101 100 11101110001010001000001111010000 0
10000001 100 11011110000000000000000000000000 0
10010101 100 11000000000000000000000000000010 1
10110001 100 00000010000000000000000000001111 1
10001101 100 11000011110000000000000000000000 0
11111001 100 00000000000000000000000000000000 0
11101101 100 10001100000000001110111000100000 0
10111101 100 11000000000001000000000000001111 1
10001101 100 11000000000000000000000000000000 0
11000101 100 11010010000000000000000000110001 0
11010001 100 11000000000000010000000000000011 1
11111001 100 00000000000000000000000000000000 0
11110101 100 11000000000001111111111111111111 1
11010001 100 11000011111111000000000000000011 1
11111001 100 00000000000000000000000000000000 0
11111001 100 10110000000000000000000000000000 1
11111001 100 00001001000000000000000000000000 0
11111001 100 10100000000000000000000000000000 0
11110101 100 10001101000000000000000000000000 0
11010001 100 11001000000000010000000000000011 1
11111001 100 00000000000000000000000000000000 0
11110101 100 11000000000011111111111111111111 0
11010001 100 11000011111111100000000000000011 1
11111001 100 00000000000000000000000000000000 0
11111001 100 10110000000000000000000000000000 1
11111001 100 00001001000000000000000000000000 0
11111001 100 10100000000000000000000000000000 0
11110101 100 10001101000000000000000000000000 0
11010001 100 11000100000000010000000000000011 1
11111001 100 00000000000000000000000000000000 0
11110101 100 11000000000010111111000000001111 1

Way better again. Especially the centre column of 100s is looking good! This is the ACK-message of the SWD-standard.

Parsing it

To parse it I had to look at the manual again *sigh*. There are some bits in the protocol that allow the chip to do sanity-checking on the signal. Start bit, stop bit, park bit, parity bit – checking for these bits allowed me to sync the signal even better. More manual readings gave me the names of the various registers and bits. Read bit, write bit, debug bit, ACK, error and all that jazz.

Behold the interpreted bit stream of a commercial programming box talking to a Freescale-chip:

needle (0x0BC11477) in LSB first format: 11101110001010001000001111010000
found needle!

skipped: 11111111111111111111111111111111111111111111111111111111011110011110011111111111111111111111111111111111111111111111111111111
AP R ?????? skipped: 11111111111111111111111111111
DP R ID DP R ID 0x0000001E 10000001 100 01111000000000000000000000000000 0
DP W CTRLSTAT -> 0x50000000 10010101 100 00000000000000000000000000001010 1
DP R CTRLSTAT 0x000000F0 10001101 100 00001111000000000000000000000000 0
AP R DATAREAD AP R ?????? DP R RDBUFF 0x00000000 10001101 100 00000000000000000000000000000000 0
AP W CSW -> 0x23000012 11000101 100 01001000000000000000000011000100 0
AP W TARGET -> 0xF0002000 11010001 100 00000000000001000000000000001111 1
AP R DATAREAD AP R TARGET 0xF0000FF0 11010001 100 00001111111100000000000000001111 1
AP R DATAREAD AP R DATAREAD AP R DATAREAD AP R DATAREAD AP R TARGET

Download the code/program/dumps HERE.

Coding it

Now that I had captured a real bit of setup-code that actually performed the thing I needed to do on the chip, I could rewrite it! With some tweaking, head-banging and by using the logic analyser again to check if my own output matched the official output – I managed to get something working. Now I have a way to dump the contents of the memory of any Cortex M0 device with an enabled SWD subsystem:

uint32_t Peek2(uint32_t address)
{
Write(false, DP_W_ABORT,0x1e);
Write(false, DP_W_SELECT,0);
Write(true, AP_TAR, address);
Write(true, AP_CSW ,0x23000012 ) ; // , SIZE_32 | AUTOINC_SINGLE |( (uint32_t)1<< (uint32_t)24) | ( (uint32_t)1<< (uint32_t)25) | ( (uint32_t)1<< (uint32_t)29));
Read(true, AP_DRW);
return Read(false, DP_R_RDBUFF );
}

Now gives the following output on my MKL02Z32 test device:

SWD-DP id: 0x0BC11477
Cortex M0 identified!
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFF7E
D0342900 22002301 4288B410 2401D32C
42A10724 4281D204 0109D202 E7F8011B
42A100E4 4281D204 0049D202 E7F8005B

Up next: writing hex-files to the built-in flash memory. To be continued..

Happy Newyear!

The TINRS team wishes you a very happy new year!
May all your devices boot on first try!
May all your programs hand you inspirational glitches to get you to places you’d never expect!

We started our own new year at the Ruigoord church – at which we had the opportunity to officially start the new year with a song.

This track has mainly been constructed with synths/effects/software/inspiration by the people on the TINRS team
Synths: Stijn Kuipers (Goldfish + Blok)
Acid Distortion & Drum synths: Lauri Koponen
Delays and DSP support: Krzysztof Foltman
Vocals: Priscilla Haring

LISTEN HERE

The yellow-panel microgameboy in action

I’ve had some great fun with the microgameboy from the Yellow Panel.

See here:

Adding levels with a custom level editor:

And.. because you sortof have to… I made a small midi-file converter and attached a piezo beeper to a leftover GPIO pin…

Initially I had some trouble getting the screen to power up on 3.3v… Turns out my init-code was sending too early. After I added 200msec delay to wait for power stabilization, the init code ran as expected and turned on the internal chargepump. Hurrah! 0.49″ OLED screens are cute!

Panel merging tool progress

It has been quite a while since I had a chance to work on the tool – I have been too busy validating the output and playing with the microgameboy, but finally I’ve had the time to incorporate some bugfixes.

The biggest one on the list has been the import of gerber files generated by Diptrace..

See here:

UPDATE – Whoops, forgot that some boards still use holes! Not everything is SMT yet 😉

Fixed the diptrace drill exports too:

ld bug 6

 

The yellow panel – prototyping utilities.

The recent DirtyPCBs.com paneling experiment resulted in a nice new addition to our prototyping toolbox:

the yellow panel.

And the yellow panel..  Dirty dirty DIRTY soldermask (check topleft)And the other side.

The yellow panel contains:

  • Wolfsom SMT microphone breakout with small amplifier
  • QFN24-to-dip adapter
  • Freescale K20 TFT backpack (enhanced Teensy3.1 without the bootloaderchip)
  • Freescale KL02Z DIP breakout with microphone
  • USB-testpoint board in USBstick form
  • 0.49″ I2C OLED breakout board
  • 3.3v MIDI IO board
  • KL02Z micro-gameboy with 0.49″ OLED, microphone, switches and battery.
  • A this-is-not-rocketscience.nl keychain

The general theme for this board is “controlling stuff with audio while having sufficient visual feedback” I will be soldering a few of these over the next few weeks to test out various ways to get light/motion things synced up to music.

The microgameboy (screens have not arrived yet – they will get their own post once the hardware is complete):

IMG_1566 IMG_1565

Code upload works! Blinky fizzbuzz LEDs!

IMG_1567

USB testpoint thing soldered in 2 configurations:

IMG_1564 IMG_1563

If you’d like to try these as well – get some at DirtyPCBs.com and ask us for schematics/bom/help on twitter!

Creating breakable PCB panels for DirtyPCBs.com

DirtyPCB seems to be the first small-prototyping-service that allows you to build panels with breaktabs. I had to try this! Soon after this thought I stumbled upon the great question of “how” – here I had all these folders full of gerberfiles for boards.. but the tools to panelize them were all very primitive, expensive, unhandy, unartistic etc… time to fix this!

Down here you can see the progress I’ve made from initial concept to usable tool.

The tool shall be released in (bin + source) full after I’ve gotten the second round of panels back from DirtyPCBs (I am not going to give away a tool that will create unproducable gerbers – I need to doublecheck everything)

Dealing with PCB artwork: procedural vector art tooling for Eagle

I like decorating PCBs. After I’ve spent ages designing and routing a schematic, I want it to look nice.

Sadly – this is very badly supported by most CAD software dealing with circuit boards. Some vector art import tools exist, but they are all very far removed from an ideal art workflow. The artist can’t really get direct visual feedback on the endresult.

To fix this, I’ve started writing some tools.
The first tool is a C# module that mimics the HTML5 Canvas2D vectorographics API but outputs scripts for Eagle CAD. Eagle can only deal with cutout-polygons on copper layers! This means that polygons with holes (like the letter O) will not have their insides emptied out if they are on the silk layer. Therefore, all polygons are converted to holeless triangle meshes. This allows the tool to import complex shapes. The first usage of this system is the text function. Any font file you have can safely be converted to a holeless polygon soup.

The second tool is a full Eagle board file importer, rasterizer and interpreter so you can extract relevant curves and use them to dynamically create graphics.

The third tool will integrate the first and the second tool with a code-editor window and a Lua backend. This should allow very fast “live coded” procedural board-art graphics. I am still working this.

Screenshots of the progress in chronological order:

The Eagle script generator starts to work:
Generating Vector Art for Eagle

Holes correctly converted to Eagle polygons (triangle soup):
Generating Vector Art for Eagle - 2

Importing Eagle board XML files starts to work (this is the PCB for the first LED badge):
Eagle Board Rendering In C#

More complex boards start to work (Goldfish R3 and Protoboard v2):
Eagle Board Rendering In C# - 2

01 - SMD Pad Rotation Correct!

Added the Eagle “ArcTo” curves -> automatically converted in to seperate line segments. (See the round corners – this is the Goldfish R3 connector board)
02 - Better layer abstractions and linewidths

And finally:  first glimpse of the combined board-reader-and-script-executing tool:
03 - Some random vectorart test

I am currently still perfecting the board-import/rendering function. After the integration of all the tools has been completed I will upload the code to our Github page.

Goldfish 4 UI board pictures

After some major drama in the workshop (leakages, iron dust cloud, broken floor, rainwater coming in, etc) I finally have some time to share a few progress pictures.

First and foremost: IT WORKS! The Goldfish R4 UI board can be used as a stand alone USB-MIDI controller! I had to do some workarounds, but it all seems to work now and I’ve used it together with a few DAWs. The current version has two modes: “control” mode and “xy” mode. In control mode you can use the encoders to control 6 MIDI-CC values at the same time, and press the encoders to select midichannels or different sets of CCs. The Goldfish keeps 36 controllers in memory, so you can see their value on the LED rings as soon as you switch between pages of CCs.
In xy mode you can control two MIDI-CC values at the same time by using the touchscreen. The left and rightmost encoders control which midi-CC is being sent by X or Y. This mode will get some “auto-LFO” options to spice things up.  

Here it is, showing the LED rings lighting up for the first time:
Ui in the dark

To save some board space, I’ve added mounting holes to re-use the Connector board from the Goldfish R3. This board provides MIDI plugs and stereo jacks. (the red PCB):
Backside fits a midiboard from fish R3

 

Development is easy: a standard Arduino-serial module plugs in to the board at the back:
Easy to program

Historic moment: First Fish! The hello-world of Goldfish development!
FIrst Fish

Lacking the time to lasercut a nice enclosure (see “major trouble” earlier 🙁 ) I just took 1 of the leftover PCBs and sandwiched the thing with some hex-standoffs to protect the insides:
Stacked with a second fish board - still needs a plexi casing
Up next – an extra Arpeggiator mode, one more revision of the PCB and some fluo-yellow lasercutting work for the casing!

To be continued!

LED Badges

Festival season is here!

And since we like glowsticks, but don’t like their nonrecyclable nature – we decided to go all out on a bunch of LED toys!

Behold:

Each smiley features 20 LEDs in a Charlieplexed setup running on an Atmel Attiny85.

The smiley PCBs were done by DirtyPCBs.com. They arrived VERY fast compared to the usual Chinese boardhouses. One week after ordering – with DHL shipping. The quality is exactly as advertised: Dirty, but good enough where it matters. The silkscreen drifted a bit here and there and the soldermask is not very strong (the copper shines through after some soldering) – BUT – they managed to do 150dpi bitmap silkscreen with no errors.

DirtyPCB smileys Smileys and Dirtystickers and Badge 1

Original design for comparison:

Smiley Design

Eagle Board and Schematic files, together with the code for the firmware will be uploaded shortly!

 

 

Lauri is working on a new audio effect rack

“I have wanted a good delay effect box for a long time. There are uncountably many delay plugins out there, but hardware has its own merits. I had experimented with the concept of deeply modulated delay lines several years ago in a buzz effect called “ld zdelay”, and it would be lovely to have something like that in my hands, in a box.”

Read his blog: evolution of one design.

His write-up is a great example of the phases a design needs to go through before getting anywhere close to production.

Lauri also collaborated on our design guide document

Exotic PCB production colours

The UI board for the Goldfish v4 is almost ready for production (post will follow soon) – so the search for fancy factories has begun!

I was quite charmed by the colours of this fish:

NYC11.07_Goldfish_White1

(found here: http://www.andreaharner.com/archives/2007/11/sos_goldfish_na.html)

Which led me to search for circuitboards with white soldermasks and red silkscreening. (or maybe a cheaper inverted option – red soldermask almost 100% covered by white silkscreen)

I found some (not so spectacular) samples:
http://www.tokyohackerspace.org/en/blog/tokyo-hackerspace-boards-first-shots

and so far I found http://project-pcb.com/ as a factory that seems to support this special option in small quantities.

Kezboards, umlauts and USB

kezboard

While searching for some easy-to-add USB options for the new Goldfish development, I revisisted the V-USB package. This package allows you to add USB to any small microcontroller that can add an interrupt to a pinchange. Link: http://vusb.wikidot.com/

While digging through earlier projects using this library, I found this amazing piece of “lets just fix this”ism:

Link: http://alpharesearch.de/?page_id=53

This particular German got so upset about the lack of umlauts across the border that he made his own personal umlaut-device. A great reminder that while technology would be nowhere without imagination, it would not even exist without frustration.

Goldfish V4 UI panel – Encoder Rings

The FPGA-based Goldfish is still in constant flux. I decided it needed more encoders on the frontpanel, AND some visual feedback for the value of each of the encoders. Each encoder now has 16 LEDs around it to show the current value/meaning.

Apparently there are some suppliers that build complete rings (like Top-Up ), but I want to build my own rings first.

fishv4 - encoder setup

 

To build these rings, I wrote a small .NET tool to generate the scripts for Eagle. (If somebody has use for this or something like it, let us know on Twitter – I think it is too small/dirty to warrant its own github project – and it has been done before by others too)
Ledpattern-generator

The final puzzle to solve before the board can be routed and fabricated is the various ways I want the chips to talk to each other.

The interface board can be used as a standalone Arduino Mega (with TFT, touch and encoders) – using serial + reset to use the Arduino bootloader

The Freescale Kinetis K20 chip can upload new firmwares using this bootloader
The K20 usb-dfu bootloader is already in place and can be extended to allow passthrough to the FPGA and the Atmega

Now.. the UI board needs to talk to either the fpga or the mk20 based on the final firmware.. and the K20 might need to send commands to the video interface on the FPGA.. or on the UI board.. and the FPGA could send stuff to the audio codec… but the current goldfish code runs fine on the K20… so an optional bridge between the audio codec and the K20 might be handy to have as well… CHOICES!! if I can cleanly upgrade the K20 to a K22, the extra FPU performance will definately warrant codec-connection to that chip…

I’ll be back in the basement trying to decide what will happen. Building an open experimentation platform is all about enabling possibilities. But at some point I shall have to make concessions even before the first experiment.

To be continued!

Drafting the new Goldfish v4 boards

After playing with the FPGA boards for a while, I decided to completely overhaul the Goldfish board.

Spending a bit more time and money will make this box much more useful for the coming years of audiovisual experiments!

The current preliminary hardware feature set:

Spartan 6 LX9 FPGA
Freescale MK20 (or MK22) ARM Cortex M4 MCU
2 small 320×240 tft screens with AVR for touch handling (1 screen for the FPGA, 1 for the MK20)
4 to 6 encoders (no more buttons, the encoders also have a button if I need something pressed down 🙂 )
2 microsd slots (again one for each)
Wolfson audio codec with headphone, lineout and linein connected
VGA and HDMI output for the FPGA
MIDI ports
USB Host port
USB Client port

This all shall fit nicely sandwiched between 2 15x10cm PCBs

Progress so far:

goldfish 4 rough draft

Notes on FPGA board design

The happy Australian is at it again!

This time, he talks about designing boards with FPGAs and explains various things about using tiny BGA (ball grid array) chips. These 3x3mm FPGAs have 36 connector-balls underneath, spaced only 0.4mm apart. Making circuit boards for these chips is still a bit too intricate for most cheap factories, but when you consider how much smaller the final boards can be – maybe using a more expensive factory evens out after all!

Making the Fletcher Capstan Table

This particular table has been all over the internet for years, but I had never found any details on the mechanics that make it work. This video provides some details about the parts that allow all the table segments to move fluidly from the small to the large shape and back.

For the more adventurous DIY freak – pausing the video at the screenshots should give enough details to construct your own! Linear stages available in Makeblocks webstore 😉

New PCB order – small DIP protoboards

Krzysztof Foltman writes: “Another PCB sent to manufacturing. This time, it’s a universal 5x5cm protoboard. If you’re a beginner at electronics and want to try making a simple electronic circuit using standard through-the-hole components, it’s probably going to save you a lot of time. It’s compatible with DIL chips but also supports double-row pin headers quite nicely – something I missed in the cheap protoboards from ebay!”

fsm 5x5 protoboard

Download GERBER files.

Fun with FPGA chips: VHDL for VGA and WS2812b RGB LEDs

In the past few weeks, Stijn and Krzysztof have been playing with FPGA chips.

Progress has been made!

Stijn has created a servicable text-mode VGA setup:
FPGA-vga

 

Eventually, a component like this will be used for quick debugging of FPGA internals and/or GUI’s for the upcoming FPGA-hosting Goldfish device. For now it provides some fancy glitch visuals by twiddling with some on-board switches.

Krzysztof has added support for the WS2812b RGB LEDs to the FPGA code repository:
FSM-fpga ws2812b - less bright FSM-fpga ws2812b

 

WS2812b RGB LEDs are extremely convenient to add some colour to your projects. Each LED comes with a built in controller and you can chain any number of them together.

You can find the WS2812b VHDL code at the github repo here. The VGA code will be added once it is a bit more complete.

Progress on new protoboards

After using our V1 prototyping boards for a while we decided to design some improved versions to make future experiments easier.

This new board is focussed on mostly analog setups:

Protoboard-Analog-V1
It features a switchable supply between USB and external power and an area for SOIC MCU’s and CODECs.

This board is an upgrade from the v1 protoboard:

Protoboard-Goldfish-V1

– The connector placement has been improved.
– There is a new hole pattern and connector which makes it fit the Goldfish platform (giving instant access to graphical user interfaces to control experiments – or an FPGA daughterboard with HDMI for heavy lifting)
– There is dedicated space for an Atmel Attiny85 beside the TQFP area which can give a quick and dirty USB interface to whatever TQFP is on the protoboard. (using the VUSB library). It can also be used to generate reference signals or bootloader portknocking.

As soon as the new Goldfish mainboard + extension header has been finalized we will add these protoboards to the next batch to be sent to the PCB factory.

Back home!

10259873_10151917466246572_7627578894474393408_n After an exhilarating and exhausting time in China – we’ve made it back home. Now all that is left to do is to go through all the pictures, recordings, sketches, business cards and memories and share our adventure!

And the parts… and the tools… and the suits from the tailor… Our suitcases were nearly bursting!

On a different note: the site-design has been recovered (and backed up).


Maker Faire Shenzhen – first impressions

We were already spotted on the platform of the metrostation “Are you coming for Maker Faire?” – “yes” – “Follow me, I show you”. It must be our geek-sjiek attitude..

Just out of the station there were many of the Maker-red-robots, drones in the air and a rather large Bumblebee (Transformers – yellow one). People were waiting for us with maps and kindness – everything has been really well marked and easy to find.

 MF Krzysztof grinning map MF guiding floor stickers

The Faire itself is bigger than we expected and outside (huh?). We were impressed by the guys from 3rd Ear, a threedimensional music experience. Also, a guy from Music Thing Modular – who builds modular synthesizer eurorack modules- gave us the PCBs for two of their modules: a spring reverb and a random sequencer. With a bit of luck we can find all the components we need for these on the markets later this week.

Other interesting things:
– Quitbit
– Bicycle lighting/tracking by Helios
– A bendable sailboat for cleaning the ocean
– Modular controller blocks

Will upload photo’s / video’s and more details later

 

Hello World!

Rocket_LaunchTonight we will start Twittering like crazy to get the engines going.  The stars are out over Amsterdam, spring is in the air and it is a good day for a launch!

On This Is Not Rocket Science you can already find descriptions of several projects we have already started; the Goldfish synthesizer, a design for a prototyping board, how to make a PCB CNC mill with Makeblock and our first crack at an FPGA board.  We will be adding more as time goes by and we and The Lab progress. If you have any hints or questions, please sing to us on Twitter @rocket_not .

Our first mission will be a trip to Shenzhen, China – where all things are made.  Our bags are packed to fly out in two days. We are curious to see how hard or easy it is to go from inspiration to reality in this environment. We are planning to go to the Shenzhen Maker Faire, meet the guys from the Dangerous Prototypes Hackercamp, visit MakeBlock and talk to Seeed Studio among many other things.

We are undertaking this trip without the burden of funding and will be updating you often and at impromptu times.


FPGA repository started on GitHub

2100838-40Krzysztof Foltman has posted his FPGA efforts so far on GitHub!

Currently the codebase contains modules to deal with:

– key-matrix input
– LED output with brightness control
– Serial port input and output
– SPI flash
– Quad-SPI flash (4 times as fast as regular SPI)

No doubt this will grow fast.

See here: https://github.com/ThisIsNotRocketScience/fpgastuff

The code has been tested on a Cyclone IV FPGA.


 

Goldfish & Platinumfish for Jeskola Buzz – Rerelease

goldfishbuzz header

Let’s make some noise!

Most development starts in a very cushy environment with great debugging support. Goldfish once started in the Jeskola Buzz virtual studio platform so I could quickly test and optimize the algorithms without having to upload and install the binaries on a PocketPC.

The Goldfish and Platinumfish synthesizer plugins for Jeskola Buzz were never released on a big platform. To keep them from disappearing from the internet, here they are again!

[DOWNLOAD]

Unpack these in the Gear/Generators folder of your Buzz installation.

Makeblock SMT-reel holder

When you can fix a problem in 5 minutes – do so directly!
In this case, a shipment of reels was uncoiling all over the place.
Something had to be done!

reelholder large
I used some Makeblock parts to build a quick reel-stand. A simple square base with a holder – like a large toilet roll holder – is now keeping the coils.
Or maybe more like a sticky-tape-holder
reelholder closeup
The blue strip is a tiny bar to keep the spillover plastic protection cover out of the way. Not used as such (yet) in this picture – but you can weave the empty plastic coil back under the blue strip to keep the plastic snakes off your work area.

HDMI research for the Goldfish FPGA stack

hdmi-connectors-34366-3007775

 

HDMI video out should be well within reach of a Spartan 6 FPGA. I am still in the process of readin up and figuring out. Here are some of the more interesting reads I’ve found. Some are interesting in-depth, technical details, some are stories of people that did this before.

 

The Hackaday link opens up different other sources and has an interesting discussion. Hamsterworks is a more in-depth technincal commentary. Xilinx, the Spartan-manufacterer, has some helpful things to say – especially on how they intended the HDMI-protocol to be implemented on their chip:

http://hackaday.com/2013/03/08/pumping-1080p-video-out-of-an-fpga/
http://hamsterworks.co.nz/mediawiki/index.php/Spartan_6_1080p
http://www.xilinx.com/support/documentation/application_notes/xapp495_S6TMDS_Video_Interface.pdf

Decisiontime:
1 HDMI port?
2 HDMI ports?
2 HDMI outputs and an HDMI input?
HDMI audio?
Maybe an extra FPGA of a different type/brand?

Two outputs would be more than enough to convert the Goldfishies into full music production battlestations.

 

Goldfish v4 – Board design progress

The Goldfish platform is slowly growing in scope and complexity.

The first three Goldfish designs focussed on getting components to work at all – microcontroller, audio codec, TFT screen and MIDI. The designs I’m working on right now will provide the processing power to do something more interesting than polyphonic ringtones.

The current plan is to move from the Freescale Kinetis K20 to the ST STM32F407VGT6 microcontroller and have an expansion header to host a whole number of other experiments. Most notably – a Spartan 6-with-HDMI board and version two of the prototyping board. This header and the new expansion boards will allow the main Goldfish PCB to become a central JTAG/Debugging environment for the next few months of audio and robotics experiments.

The main Goldfish PCB so far

Goldfish-STM32 with expander

The MCU board has a few extra features compared to Goldfish version 3 -> there is an extra microSD slot and a big row of expansion pins. USB and reset/program button have been moved to the other side to accomodate the different microcontroller pinout and give a decent place for the pin header. The routing is just a quick autorouter test to see if it would still be possible at all to route it. This design is nowhere near final.

The Spartan 6 FPGA board so far

Goldfish-FPGA stack

This is my first FPGA board. I started with the Papilio Pro schematic as a known-to-be-working configuration to start from. Power and IO have been moved around a bit, and the FTDIchip-JTAG setup might be replaced by just a JTAG header. The connected Goldfish microcontroller board should be capable of uploading data to the SPI flash later on anyway, replacing the need for the FTDIchip.

As soon as I can get my hands on a few PCB-mounted HDMI connectors I will add two or three to the board. I’ve been reading up on HDMI-FPGA combinations, and the Spartan-6 FPGA should easily be capable of hosting a few videostreams – even 1080i is within range! (there will be some separate posts on this subject)

Currently I’m putting further development of these boards on hold until I’ve been to the Shenzhen markets. I have no doubt I will find more interesting screens/buttons/leds/plugs to use there – so it makes little sense in finalizing the layouts before going to China.