Ana Cabral

Week 4

Electronics Production

back to main page

The assignment

This week assignment was to make an in-circuit programmer by milling a PCB.



Where is the 1/8” collet?

First of all, the machine in FabLab SH is the Roland SRM20 and the standard collet that comes with it is the 1/4 “. I ordered the 1/8” collet from an european supplier, but it didn’t arrive in good time. We were lucky enough that one of our colleagues in the lab has his own desktop milling machine, a Roland Modela MDX-15 and kindly brought it to the lab and put it at our disposal. Thank you, Michael! :)



Roland Modela MDX-15 and FabModules, plan A

Plan A was to run the modela MDX-15 using FabModules, from the computer I was already using, a MacBook Pro. I tried to setup FabModules, using Mac OS, following the instructions here.

So, I…

Because FabModules is set up for Linux, I had to identify the correct device name in Mac OS and insert it in FabModules.

After all this, connection was established with the machine, but not reliable - the modela moved 2 times out of a lot of trials and could not execute 2 moves in a row.



Roland Modela MDX-15 and FabModules, plan B

So, I decided to install Ubuntu and have a dual boot in the MacBook Pro.

For that, I installed UNetbootin, in order to burn an ISO of Ubuntu in a usb. Then restarted the computer and when rebooting, chose to boot from usb and “try ubuntu” to check if everything was working. Unfortunately, there was problems with the network. I couldn’t get internet access, neither wireless or cable.



Roland Modela MDX-15 and FabModules, plan C

Completely desperate and anxious to start milling, I found a computer in the lab that was not in use, erased Windows OS and installed Ubuntu, user friendly versionn of Linux OS (checking first from a USB boot that the network and everything else was working).

I proceeded by…

The way to download and install in Linux OS is slightly different, but there are many good tutorials online. Installing nodejs got me stuck for a while, until finding out that I had to write “node-legacy” instead. (but git suggested it itself, after I simply typed “node” and enter key)

After typing “npm start” and git replied “listening to….”, I opened FabModules by typing in the browser “127.0.0.1:12345”, set up input, output and process, try to move to starting point but got an error message, permission denied. Found some tips online, advising on changing permission settings for current user by adding user to dialout group and change atributtes for a file/folder/device through chmod command.That was done by typing:

sudo adduser [username] dialout

sudo chmod a+rw /dev/ttyUSB0

And finally… IT WORKED!!!!!!! There was a solid communication between FabModules and the modela MDX-15!!! YUHUUU!!!



Milling and Soldering "Brian"

Compared with all the previous frustration, milling the PCB was quite straight forward. I used a PCB, flipped, as a sacrificial layer. Then double sided tape, both to fix the sacrificial layer to the cutting mat and the PCB to the sacrificial layer. I uploaded the traces png from Brian into FabModules as input, then defined the output (Roland mill) and process (traces 1/64). I defined the x and y zeros through FabModules and used the buttons in the machine to define the z zero approximately. The final z zero was defined by losing the end mill and letting it “fall” on the PCB. Clicked in calculate and then send.

The first 2 times I tried to mill the traces file, I didn’t succeed. The first time, part was not engraved, suggesting that the PCB surface height was not even. The second time, I could hear the machine was making a lot of effort… taking a closer look, I could see the PCB was moving, not well fixed.

So I stopped the process to inspect and found out that the cutting mat was very dirty from previous jobs, resulting on uneven heights and bad adhesion.

I cleaned it well with alcohol and repeated the process. Everything worked well, both for milling the traces and, later on, the outlines with the 1/32” end mill.

When everything was done, I removed the “Brian” from the PCB plate and cleaned it well with alcohol.Brian has excellent documentation, so I kept on following it. Found all the electronic components and started the soldering. I used solder wire. I made a couple of mistakes, but found it quite easy to “unsolder” using the heat gun method. I started with the wrong capacitor, due to ignoring the unit (uF, nF or pF). See more about conversions in Farad here.



When the programmee becomes the programmer

I decided to use Linux (Ubuntu) for programming the programmer. Following Brian’s instructions, I installed the software for AVR programming, and downloaded and built the firmware.

As Brian suggested, in the Makefile, I substituted the line “PROGRAMMER ?= usbtiny” by “PORGRAMMER ?= atmelice”. Saved the Makefile after the changes and run make flash, but kept getting an error

“avrdude: jtag3_initialize(): part ATtiny45 has no JTAG interface”

“avrdude: initialization failed, rc=-1”

So, to troubleshoot, I ran the command avrdude, to see the options. Decided to check -p (part number) and -c (programmer). For that, I ran avrdude -p xxx, where could see t45 for ATtiny45 and avrdude -c xxx, where I could see I should use atmelice_isp, because atmelice was defined for JTAG.

Before changing the Makefile, I ran avrdude -p t45 -c atmelice_isp. It asked to double check connections… so I tried to change he orientation of the cable connecting the programmer and the header pins. It then worked! It could recognize both the programmer and the ATtiny45 in the usb.

So I made the change in the Makefile atmelice —> atmelice_isp. Got back to Brian’s tutorial and everything else went smooth. So I ran make flash, then make fuses. Then I unplugged both the usb and the programmer and plugged the usb again (only usb now, not the programmer). I ran slusb, to show a list of usb devices and verified “Multiple Vendors USBtiny” was part of the list! YEAH! So it was recognized as a USBtiny programmer!! :)

The final step was to plug both usb and programmer once more, and run make rstdisbl. Then, unsolder the bridge on the usb (see pictures underneath). And TADAAA :)



Learnings from this week

This week was full of tours and detours. A week that seemed so straight forward, with plenty of room for experimentation, ended up full of rabbit holes and being extremely time consuming.

But I clearly felt I was constantly learning… it’s when things don’t work, in the debugging process, that we learn. The more things we tried and didn’t work, the deeper we looked.

There was a lot of learning “between the lines” this week like…

Besides, I regret that I started documenting so late… but it is extremely hard to document in the middle of the assignment, to know what is worth documenting when experiencing and experimenting so much. I have made a note to myself that I should make it a routine, in the end of each day, before closing files and command lines in the computer to take a couple of screenprints and “make sense” of the work that day through writing.

This week made me realise my knowledge in how operating systems work is very limited. It was an eye opener, a lot of questions fired up in my brain and I believe now I’m very motivated to absorb all info I can on the topic.