First experience with programmable logic

Lattice MachXO CPLD
Above is a picture of the board running my first project written in VHDL, a simple binary up counter.

I have been wanting to try out programmable logic for some time now and finally have come around to getting a development board. The thing that put me off from wanting to try to get into CPLDs/FPGAs was the price of the development boards (unfortunately, most FPGAs and also bigger CPLDs come in a BGA package which is impossible to solder without a reflow oven).
Continue reading

Panelizing PCBs for production using gerbmerge

I have just ordered some PCBs at iTeadStudio for my low pin count PIC breakout board. The board size is 2″ by 1″. The smallest PCB size you can order at iTead is 2″ by 2″ (5cm x 5cm).
Of course you can just pay $10 for only half the board space, but it would be much nicer to get two of the boards on one board and then cut the boards apart using a hecksaw.

I used the Python script gerbmerge (for installation instructions see here) to duplicate the Gerber file to create a 2″ by 2″ board.

Continue reading

Installing gerbmerge on Ubuntu

The python script gerbmerge allows you to copy and/or merge Gerber-files so you can send them to the PCB manufacturer as a panel or a single board.

This is especially handy if you are using services like Seeed Studio’s or iTeadstudio’s prototyping PCB service. Laen (@laen) uses gerbmerge to panelize the ordered PCBs for the OSHpark Purple PCB service

Gerbmerge can do a lot of things with you Gerbers, however it is not so easy to set up and configure.

Instructions on how to install gerbmerge:

Continue reading

Workshop Update #4 – SD card and FAT16 implementation

This is the 4th workshop update!

As you can see from the last two posts I am working on an SD card based data logger board. I have worked on getting the SD card communication protocol up and running and also have written my own FAT16 file system implementation (it’s pretty crude, though).
Continue reading

Workshop Update #3 – SD cards and SPI bus

At the moment I am working on an SD card data logger (well actually it logs to a microSD card). I have been wanting to do this for quite some time now. This project is going to be done from the ground up. I am going to write my own implementation of an SD card library. I still have to find some good on information on the FAT16/FAT32 filesystem I plan to use on the (micro)SD card.

I came up with the first concept for an SD card data logger back in September last year. I wanted to create a datalogger so I could log the temperature and humidity inside a room. I found that this design would have been very specialized and I quickly dropped that design.

A project like this came back to my mind when I saw the OpenLog in a SparkFun product video. While I think the OpenLog is a nice approach to serial data logging at the same time I find that it’s a massive waste of processor resources. Most of the µC’s GPIO pins are not broken out and they are employing the ATmega328P just because of the high memory requirements when implementing SD card data logging (more exactly the file system).

So I breadboarded an SD card and an ATmega328P and after writing some code, I managed to initialize the SD card. Now it is time to implement the filesystem handling and to actually read and write data to the card.

I have come up with a design which gives me the capability to log to a microSD card and still gives me access to all the free GPIO pins using 0.1″ headers so it is breadboard compatible. It also includes an ISP connector so that I am not dependent on any bootloader.

The communication with the microSD card employs the hardware SPI on the microcontroller.

As always I am waiting on the boards to arrive and then I will have to assemble the board and get the code up and running!

Hardware threadbare nightmare

Currently I’m setting up a Linux based computer to run in my lab so I don’t have to carry the boards around between my bench and my PC all the time. It will also simplify testing because I can do it all in my lab.

This little report of mine should give you an idea of how to go about setting up an old PC for your lab and which issues you might face when using really old hardware.

Continue reading

Workshop update #2

So this is the second workshop update!

This is how the oven controller PCBs will look like. I have ordered them from OSHpark

At the moment I am working on a reflow oven controller to mod a pizza oven for reflow soldering. After the break you can read more about the project!
Continue reading

Measuring temperature with your microcontroller using NTCs

Often you want to measure environmental variables with your microcontroller, e.g. brightness, temperature, humidity, gas concentration etc.

Measuring a temperature with a microcontroller can be done in several different ways depending on the accuracy required and temperature range involved. A thermistor (temperature dependent resistor) can be used as a cheap temperature sensor for temperatures ranging from -40°C up to 125°C.
Continue reading

Plotting serial data using GNUplot and Python

Sometimes it can be useful or necessary to plot some data that you get from your microcontroller. As most microcontrollers do have a USART peripheral the data to be plotted can be sent to the computer via the serial connection.

The most popular program for plotting and working with datasets and performing mathematical operations on them is probably MATLAB (Octave being an open source alternative).

When it comes to simply plotting a stream of data there is a much easier method to do so – it’s even free and fully open source!

plot

Continue reading