Scott Zitek - Fab Academy 2014

Electronics production

Week 4 Assignment

The assignment for this week is to make a FabISP in system programmer for AVR microcontrollers. This involves cutting the circuit board, soldering the components on the board, and then programming the microcontroller.

I was concerned about how the Andy and Valentin designs used the circuit board as a USB connector. I think it is efficient, but I didn't want the circuit board hanging out of the computer and possibly stretching out/damaging the USB port. In retrospect, I could have just used a USB extension cord.

I decided to make David Mellis's FabISP design. Details and files for David's FabISP can be found at

Cutting the Circuit Board

  1. I used Ubuntu Fab modules to control the Modela. At first the Fab Modules would not work with our Modela. I found directions online on how to change the default USB communications for the Modela to the serial communications needed to work with our older Modela.
  2. 	sudo apt-get install setserial
          	sudo setserial -g /dev/ttyS[0123]
    	recieve response.....
    	at113@at113m42698:~$ sudo setserial -g /dev/ttyS[0123]
    	/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
    	/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
    	/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
    	/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
    	sudo pico /usr/local/bin/fab_send
    	change all occurances of "/dev/ttyUSB0" to "/dev/ttyS0"
    	- press ctrl+O to save the file, ctrl+X to exit the editor
           	sudo pico /usr/local/bin/rml_send_gui
    	change all occurances of "/dev/ttyUSB0" to "/dev/ttyS0"
           	- press ctrl+O to save the file, ctrl+X to exit the editor
  3. When I try to test moving the modela using rml_move 10 10 , I received the error: "could not open port /dev/ttyS0: [Errno 13] Permission denied: '/dev/ttyS0'"

  4. I looked up the error online. The suggested solution was to add my user account to the dialout group:
  5. 	sudo gpasswd --add at113 dialout   <-- at113 is the login account
  6. Then log out and log back in again for the changes to take effect. This solved the problem. I also found the following suggested solution. I didn't try it.
  7.        chmod +x ./*
           sudo mv bin/* /usr/local/bin
  8. Now that Fab Modules was able to work with our Modela, I was able to continue. I started Fab Modules by typing fab into the terminal interface.
  9. Select "from format" and "to process" to run the appropriate module.

  10. Click on the make_png_rml button. When the make_png_rml module opens, load your png file for the circuit and select the mill traces (1/64) option. I also changed the xmin (mm) to 20 and the ymin (mm) to 5 so that it would cut the board out at about the middle of my circuit board. Click on the make.path button to see a preview.
  11. In the preview, blue lines are cuts and red lines are clearance moves.

  12. You need to set the number of offsets based upon how much material you want to remove and how long you have to cut the board.
  13. (left)offset = -1 cut everything but traces, (middle) offset = 4, (right) offset = 1 cuts only one path

  14. Cover the entire back of the circuit board with double-sided tape. Be careful to not overlap the tape or get wrinkles in it. The circuit board needs to mount completely flat.
  15. Double-sided tape is used to hold down the circuit board for machining.

  16. With the Modela mill on, pressing the view button toggles view mode on and off. When in view mode the green LED near the view button is lit and the machine moves the spindle up and the work table all the way forward and to the left.

  17. Carefully remove the existing tool from the spindle and install the 1/64" flat endmill. There should be two hex set screws holding the tool in the spindle. For now, make the tool fairly short and tighten the set screws just enough so the tool doesn't fall out.
  18. The 1/64" endmill is very small and very sharp.

  19. Tape your circuit board down firmly. Notice that we have an acrylic sacrificial spoil board under the circuit board. We machine this to make sure we have a very flat surface. Otherwise we had problems with the circuit board not cutting at the same depth over the entire surface of the circuit board.
  20. Modela with a circuit board taped down and ready to cut.

  21. Press the View button to exit the view mode. The spindle should move back above the part.

  22. When you turn off the Modela mill it forgets where it z=zero location is. You'll need to move the endmill over your board so you can lower it to the copper. I used the move to xmin,ymin button in the make_png_rml module. This moves the modela to the x and y I will use as the origin when I generate the rml file. In my case it is xmin=20 and ymin-5.

  23. Now set the z=zero location. Press the down button to lower the spindle until the tool is just a short distance from touching the top of the circuit board. Do not plunge into the circuit board with the tool.

  24. While holding the tool with two fingers, loosen both the set screws on the spindle, and carefully lower the tool tip until it touches the top surface of the circuit board. Do not let the tool just drop down, it may break the tool tip. Also remember that the tool is very sharp. While holding the tool firmly touching the top of the circuit board, tighten both spindle set screws snuggly.

  25. Click on make.rml in the make_png_rml module and then click on send it!. When the Modela output screen appears click on Begin Milling
  26. Notice how the remaining time is 7:10s, turns out that is actually 0.71 hours (approximately 43 minutes)

  27. Wait for the Modela to do its thing
  28. It takes many cuts for such as small tool to remove most of the copper on the circuit board.

  29. When the machine is done cutting out around the circuit traces, repeat the process to cut out the board using a 1/32" end mill.

  30. Use the png file for the outline of the circuit board. Select cutout board (1/32).
  31. Notice that this should only take about 3 minutes.

  32. Install the 1/32" endmill and reconfigure the z=zero location and x,y reference position.

    It takes many cuts for such as small tool to remove most of the copper on the circuit board.

  33. When the machine is done, vacuum up the debris and remove the board. Removing the board and leftover tape was not easy. At this point, I questioned my use of permanent double-sided tape.

  34. Clean up the board. I used alcohol and a small brush.
  35. If the circuit traces have rough edges try scraping them with a steel rule to clean them up.

Soldering the Circuit Components

  1. My eye sight is not as good as it used to be so I decide to try soldering using a stereo microscope.
  2. Soldering station with stereo microscope, component layout, etc.

  3. I started on the left side of the board and worked my way to the right.I took a while to get used to soldering with a microscope. The solder looks like a pipe and the tip of the soldering iron looks like a tree limb.
  4. This is what it looks like through the microscope lens. Big and clear but with very limited peripheral vision.

  5. My soldering skills improved with each component. At first the components were not soldered straight and had too much solder on them. As I filled the circuit, I got faster and my solder connections improved.
  6. Notice improvement from left to right.

    Finished board

  7. The traces seem smaller and more fragile then they need to be. This only caused one real problem. When trying to solder a temporary jumper across SJ2 I burned the trace off and scorched the board a little.

    If you look closely at the bottom of the picture, you may notice the Scorched board and small amount of missing trace

Observations regarding soldering:

Programming the ATTiny44 Microprocessor

Before you can use your FabISP the ATTiny44 Microprocessor chip on it has to be programmed.

  1. To program the ATTiny44, I needed to install AVRDude (for programming AVR microcontrollers)and GCC(to compile C code).Since I am using Ubuntu, I typed the following using the terminal interface:
  2. 	sudo apt-get install flex byacc bison gcc libusb-dev
    		- type "y" when asked
    	sudo apt-get install gcc-avr
    		- type "y" when asked	
    	sudo apt-get install avr-libc
    		- type "y" when asked
  3. I then downloaded the firmware zip from David's FabISP page. I unzipped the file into a folder on the desktop.

  4. In the firmware zip file.I had to edit the edit the make file to configure it for the in-system programmer I would be using to program the ATTiny44. I used a commercially available Atmel AVRISPmkII in-system programmer. So I had to edit the make file:
  5. 	original
    	AVRDUDE = avrdude -c usbtiny -p $(DEVICE)
    	AVRDUDE = avrdude -c avrispmkii -P usb -p $(DEVICE)
    	AVRDUDE = avrdude -c avrisp2 -P usb -p $(DEVICE)
    	I tried using AVRDude with both "avrispmkii" and "avrisp2" settings and it seemed to work either way.
  6. I powered my FabISP by connecting it my computers USB port - good sign, no smoke, fire, or errors.

  7. I connected the Atmel AVRISPmkII in-system programmer first to a USB port on my computer and then to the header on my FabISP. According to the AVRISPmkII manual, the AVRISPmkII has a 3-color status LED that works as follows:

  8. LED Color Description
    Red Idle - No target power
    Green Idle - With target power
    Orange Busy - programming
    Orange blinking Reverse target cable connection
    Red blinking Short-circuit on target
    Red-orange blinking Upgrade mode

    Another good sign. My LED is green. Notice piece of copper foil across SJ2

  9. I then typed the following commands into the Ubuntu terminal interface.
    	cd Desktop/firmware   <--- need to be in the firmware directory 
    	make clean
    	make hex
    	sudo make fuse
    	sudo make program

    The response was:

    Success - AVRDude is done

  11. I successfully went through the entire ATTiny44 programming sequence without receiving any errors. Now my FabISP should be recognized as a usb device. I disconnect it and plug it into a USB port and then run the terminal command lsusb:
    at113@at113m42698:~/Desktop/firmware$ lsusb
    Bus 001 Device 004: ID 0424:2512 Standard Microsystems USB 2.0 Hub
    Bus 003 Device 002: ID 0461:4d22 Primax Electronics, Ltd 
    Bus 005 Device 002: ID 413c:2106 Dell Computer QuietKey Keyboard
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 005: ID 0424:2602 Standard Microsystems USB 2.0 Hub
    Bus 001 Device 006: ID 0424:2228 Standard Microsystems 9-in-2 Card Reader
    ----> My FabISP device is not listed <----
  13. I tried different USB ports. I checked the circuit again for shorts, opens, incorrect parts, components in the wrong location, components with the wrong orientation (polarity), and checked voltages. Everything looks good.

  14. I have a second "David's" FabISP that our electronics Technician soldered. I was able to program it without any problems but it is not recognized as a USB device either.

Status update:

With all the circuit boards I made as part of Fab Academy, this circuit was the only one I had a problem getting to work. When it did not work at first:

When I finally got a chance to spend some time looking at it, I considered the symptoms:

So I suspect either the circuit between the USB connector and the ATtiny has something wrong with it, or there is something wrong with the 12MHz crystal or the fuse settings related to it.

I focused on the software because I have three circuit boards with exactly the same problem. I thought, what are the odds all three circuits would have similar solder problems?

The problem turned out to be caused by a newbie mistake.

You can see the mistake in this picture that was already posted earlier on this page.

Resistor R5 is specified as a 499 ohm resistor. The 4993 resistor code indicates that I had installed a 499k ohms resistor which is way off. To fix the circuit I had to install the correct resistor coded with a 4990. Since for some reason all three circuit boards had the same problem they all had the same symptom. I suspect the bag was labelled incorrectly and none of us double check the actual code on the resistor.

Back to index