Last updated: 07/03/2016
Make the Fab (tiny)ISP in-circuit programmer.
1.Describe the process of production;
2.Demonstrate correct workflows and identify areas for improvement if required;
Shown how I made and programmed the board?
Explained any problem and how I fixed them?
Included a hero shot of my board?
This week consisted of producing a programming board, in particular the FabISP. In this page I explain the process I went through: milling the PCB, soldering the components, designing the case and eventually programming the microcontroller. Unfortunately, my week went not that smooth, so I also explain the struggles I had in actually getting the PCB to work. In particular, the redesign chapter also includes the explorations that I did with producing PCB with both the laser cutter and the vinyl cutter.
is a programmer that allows for loading code on AVR microcontrollers (e.g. ATtiny, ATmega). The FabISP is based on Dick Streefland's USBTiny
who put together a clear explanation of what the programmer is and what it is used for. We choose v2.3, which contains a cristal timer and has the USB hardware architecture.
Milling the circuit
In Siena we have a Roland SRM-20. The printplate we soldered is made out of phenolic paper
, which is a fairly little toxic material to machine.
In the following I explain the steps of machining the pcb, starting from .png files of the circuit to be produced.
1.Gather the drawing of both the etching and the cutting as two separate .png files , ;
2.Upload the etching file to FabModules
and launch the interface;
3.Prepare the first file, keeping the standard settings for the machine (Roland mill, PCB traces 1/64). On the right column you select SRM-20. The only thing you might want to change is the amount of offsets. I used 4, which resulted in a fairly fast and clean work. When setting the offset to -1 you get all the white part removed
4.Carefully tape the board to the base of the machine;
5.Manually install the first drill bit (1/64 of an inch) which is used for etching only. This is a careful operation, as show in the picture below.
6.Set the XYZ manually from the Roland software. As shown on the picture below, on the left part of the interface you can move the drillbit around, while on the right part you can set the origin points for the jobs. While operating, be sure to be in "User Coordinate System" mode. The fact that there is no interface on the machine itself is quite unhandy.
7.Launch the first work. While executing, check that it makes dust, because it should;
8.Prepare the second file and keep the standard settings (Roland Mill, PCB outline 1/32). In this case, one offset is enough;
9.In the same way as before, mount the second drill bit (1/32 of an inch) which is used for cutting only;
10.Re-set the Z axis;
11.Launch the second work;
12.Gently take the board out;
After that, we started to "mass-produce" boards. In order to optimize the process we did first do all the etching and we later did the milling. By setting the options to "Machine Coordinate System" you can read and store somewhere the coordinates for repeating the jobs later with the other drillbit. Again, the interface is not super-friendly as it does not allow you to manually insert values.
Gathering the components
Even though in this case it was already arranged by our tutor, a normal workflow would involve finding (perhaps buying) the components for the board. Sellers are DigiKey
(cheaper but with longer delivery time) or RS-Online
(more expensive but they deliver in 24h). We used SMT components, which seemed a bit challenging to find. The components used for producing this board are:
||Quartz 20 MHz
Apart from that, I also used flat cable and connectors. On a side note, the only components with polarity are the zeners, the microcontroller and the quartz.
In this section I put together a list of tips and tricks that I learned when soldering:
1.Soldering should be done at 350-370 degrees, even though it is always better to check the datasheets of the components to make sure not to fry anything;
2.The order of soldering should be from inside to outside;
3.The order of soldering should be from small to big parts;
When soldering the board I looked at the schematic below.
The steps I followed are the following:
1.Melt some tin on the pad of the pcb;
2.Place the component and stick it on the one side;
4.Rouoghly solder it;
5.Solder with some tin the other pin, leaving the iron there 8-10 seconds;
6.Heat again the first pin, on order to obtain a shine-smooth surface;
It is worth being mentioned that we had two wrong components in the inventory that we still included in the board design. C4 is definitively the smallest capacitors ever being soldered by humankind. It was a painful process, especially because it was even difficult to grab it with the plyers. Next to that, the quartz was also of an unanticipated configuration: it had 4 pads, of which 2 are attached to the armature. Through two wires I attached the quartz to the PCB. This version, first manufactured by Matteo Sirizzotti, is our "FLYING QUARTZ FabISPKey v1.0"
First I started with this tutorial
that clearly explains how to 3D print a plate to fix under the board in order to achieve perfect fitting with a USB port. Following the tips of Nickolas
I found out that the optimal thickness for the casing would be 0.5mm. From his own sketches I just modified a bit the dimension of the top hole .
Since we did not have another FabISP to programm ours, we used an Arduino Uno as an AVR-ISP to upload the registers on our own FabISP. There were a couple of websites we looked at, such as the work of Giacomo
. Eventually Instructables
seemed very clear. I followed these steps:
1.Make sure that Arduino IDE is up-to-date and upload the ArduinoISP sketch to the board;
2.Connect the two boards according to the schematic below;
3.Download the firmware ;
4.Edit the Makefile before using the Arduino, according to the device you are using to upload the firmware.
#AVRDUDE = avrdude -c usbtiny -p $(DEVICE) # comment this line
AVRDUDE = avrdude -c arduino -b19200 -P /dev/ttyACM0 -p $(DEVICE)
5.Enter the folder Makefile, open the terminal and run the following commands:
sudo make fuse
6.Here is where I unfortunately got hold. I got the feedback "invalid device signature" which means that I made some mistake in the hardware. Game over.
I started to thoroughly check all the hardware connections, since I knew that the software implementation was correct, as it worked on the board of my colleagues. With the multimeter I tested a couple of things:
1.Resistor values, to make sure I placed them correctly;
2.Diodes flow, to make sure I did not invert the polarity;
3.If the board was actually alimented with 5V;
Overall, I could not really find any evident mistake, which was kind of really frustrating. This tutorial
quite nicely puts together what the most common mistakes can be when soldering. It seems that a common mistake with surface mount components is the insufficient wetting of the pad, which happens when you heat the pin instead of the pad. However, I got a bit too much frustrated with it and I decided to do it from scratch.
For the redesign I choose this
board, which has a resonator instead of the crystal. In the pictures below there is the initial drawing (left) and the re-design made by Nicola Buccioli
with a usb-adapter.
Starting from Nicola's file I made mine . With our beloved Trotec Speedy 400 Flexx I did some tests in order to understand whether it is possible to machine nice PCBs and make a comparison with the Roland milling machine. In specific, I tried to engrave a 2 mm phenolic paper
I used two boards as testing pieces, one is the Satshaskit
and the other one is the FabISP version of Nicola Buccioli
. Engraving happens with the use of the fiber laser pointer. The cutting, instead, is made with the regular Co2 laser. It is important to remeber to first engrave the cutting lines in order to remove the copper film. Otherwise the Co2 laser is not going to cut it. Below I report the results from the first two pairs of tests. On the left I only tried to engrave, while on the right I cut the FabISP.
If in the first trials I only modified the power and the amount of passes, with the final ones I started to lower the speed, which turned out to be a successful strategy. Eventually, I realised how vital it is to tune the export settings from Illustrator, before editing the paramenters in Job Control. I started to obtain good results in a reasonable amount of machining time only when I exported the files to Job Control with 1000 DPI. Especially in order to clean small gaps between the traces, it is vital to export at that resolution. Eventually I managed to laser the FabISP with the settings reported below. One need to consider that 4 passes are going to burn a little the paper underneath the copper, yet they are necessary when the traces are really close to each other, such as the traces of the AtMega328 microcontroller.
At last, I decided to also try with the Roland vinyl cutter. We had copper film laying around and we gave it a go. Unfortunately, the traces were too tiny and the blade just started to drag them around at some point.
Getting back to the FabISP, the components used for producing the board are:
||Resonator 20 MHz
After soldering the components, here is the result. Yes, there is a ton of flux around the resonator, but I unfortunately had the wrong component packaging in stock.
I then used Matteo's FabISP to program mine.
This time both the make fuse and the make flash went well!
Finally, I still had 2 more problems:
1.I had troubles in seeing my ISP from time to time, when launching the command lsusb from the terminal. I solved this by buying a male-to-female usb adapter that did the job.
2.The ISP could not power another board, because I removed both the jumpers. After I had checked the schematic, I resoldered the proper jumper.
Now the fabISP is up and running!
Thanks to the many mistakes I made I could learn a lot, especially how to solder fine components and look for bugs in a circuit. Apart from the many hours spent soldering, I also learned the basic of the process of getting a virgin microprocessor to work. I liked the topics and I completed the assignment only 2 weeks later the official deadline.
On a side note, I did compare the use of lasercutting technology with the use of the Roland SRM-20 to produce. My feeling is that the lasercutter is a more appropriate way of fabricating PCBs. On the positive note:
1.You can easily produce 0.1mm traces withouth the risk of breaking them;
2.The whole file gets executed in one go, without having to manually replace hardware;
3.You can put fancy logos to your board!
On a negative note:
1.It takes something like 15% more than milling;