Electronics Production

In this assignment we contruct an In-System-Programmer (ISP). It is used on other lessons and on the final project to program the electronic devices that control machines or automate other tasks. The steps to construct this device are:

Preparing the files for milling and cutting the PCB

Electronic circuit board fabrication is done by one of two methods. The chemical method is the most contaminant. The cutting method contaminates less because it does not use poisonous chemicals. We used the cutting method. A milling bit cuts the copper mask at the places that should not conduct electricity leaving copper conductive paths which replace wires.

Calibration

A test board is milled with the different distances for checking which is to be used for the final boards.

The source files from Neil's site

 bildoj
 bildoj

The resulting board we made as a group

 bildoj

Software for making the PCB traces in Gcode

mods.cba.mit.edu

Using mods.cba.mit.edu gave us problems. It generated G-code that LinuxCNC did not recognize. It would not load G-code files produced by mods.cba.mit.edu.

When opening that website, the code (which can be downloaded for local use) presents several modules for the various tasks done to FabAcademy files. For transforming PNG files for use with the CNC, I followed this process:

This file did not work in Axis software from LinuxCNC.

Inkscape GcodeTools

Inkscape can produce G-code! I have still to understand how. But, by reading the output file, I have found codes:

I am not sure if these correspond to the definitions I have given. But I think that G-code is not complicated. I expect that the G-code output of some simple drawings can teach anyone how to write directly on G-code. That can prove useful for making exact contours. They can be checked by showing the traces on LinuxCNC.

There are instructions on Gcode Tools.

I could not generate this file in Inkscape.

Mods

This old version of mods could create a trace in Gcode

 bildoj

I made Gcode for my board with these parameters.

 bildoj  bildoj  bildoj

Which generated this file

 bildoj

But it would not work on LinuxCNC's Axis. Possibly the parameters that were default on Mods were not as good as the ones in FabModules.

Fabmodules

I used the FabModules webpage to generate the files in G-code.

Choose the source file format

 bildoj

Find the file on your drive

 bildoj

Select the Gcode output format

 bildoj

Select either the milling process

 bildoj

or the cutting process

 bildoj
First model

I used the design of the attiny.44.ISP board in raster image. I modified it as follows.

skizo elektronika

The border is as such.

ekstera skizo elektronika

The components in bold were not available.

alt: bildo komponera

These are the parameters that FabModules expects:

 superaj parametroj FabModules-aj  malsuperaj parametroj FabModules-aj

These are the parameters that I have changed:

 depth  offsets  overlap

These are the generated paths with 1/64 inch bit generated by pressing the calculate button. (They are used for 1206 size components.)

 vojoj

I lowered the number of times the bit cuts because I was told that too many offsets will destroy the paths.

 offsets

And this is the result.

 vojoj

This is the trace for the outer cut with 1/32 inch bit.

 ekvojo

The traces of this board were cut too thin and broke.

The final G-code for the traces is saved as an NC traces file as well as the cut file. These are the traces file and the cut file for another version. These are the GIMP files with the modified image source for sending to FabModules.

This model was not possible to construct. All the components were not available.

Second model

Using this image file:

 bildoj

I followed this process for milling

 bildoj
 bildoj  bildoj
 bildoj
 bildoj
 bildoj

And this process for cutting

 bildoj
 bildoj  bildoj  bildoj
 bildoj
 bildoj
Third model

I test my classmate's design.

 bildoj

Here are the components. I source a combination of resistors in series to replace the ones I could not obtain.

New circuit
alt: cirkvito kun resistorj plusigoj

New trace image
alt: cirkvito kun postsigaroj

New border cut image
alt: randa cirkvito

Result
alt: la nova cirkvito trancxila

The new circuit is not good. The design looks good. But (in production) it has a joint in traces of the board. I must mill another board.

Working model

I used the image from the FabTinyISP tutorial and that worked flawlessly.

 bildoj
 bildoj
 bildoj
 bildoj
 bildoj
 bildoj
 bildoj  bildoj

Using the CNC Mill

I milled and cut the board with libre software from LinuxCNC which is installed in a computer that is connected to the milling machine. I loaded the G-code by way of a USB flash memory.

Disclosure: Some of the pictures are not of my board because we worked together with a peer on some of the processes.

 bildoj  bildoj

Axis software on CNC mill's LinuxCNC

This is Axis' interface

 bildoj

We must first deactivate the emergency button.

 bildoj

Then startup the machine.

 bildoj

Select the Z axis to setup

 bildoj

Create a new Gcode file with Autolevel software. Load this new file in Axis software and start the step by step process.

 bildoj

until the tip senses the board.

 bildoj

Then press the home button and let the rest of the milling continue automatically (not step by step).

 bildoj

The second error message always appears. But the milling continues normally.

Preparing to mill the board

Cutting a piece of the big board to fix to the table.

 bildoj  bildoj

Sanding the board to have a uniform Z axis correct sensing.

 bildoj

Fixing a plywood board to hold the PCB to the table.

 bildoj

Fixing the PCB to the plywood with double sided tape.

plako kun algluigumo

The board is now fixed to the plywood.

 bildoj

Tools

 bildoj

I use the CNC sensor for the computer to detect the height of the drill bit.

 bildoj  bildoj
sentilo traborila  bildoj

Using the sensor to align the Z (vertical) axis.

 bildoj  bildoj  bildoj

And fix the sensor up high once we want to start milling

 bildoj

The board is not horizontal. So we held down the board while cutting. This is a very dangerous practice. Latter, we learned how to level the board in order for the cut to be at the same depth throughout the board. (This is not my board. But this shows the reason I had problems with mine.)

plakon trancxi  bildoj

We form the board with one mill bit and cut it with another mill bit.

sxangxi la traborilon

The mill working

 bildoj  bildoj

Changing the bit from milling to cutting.

 bildoj  bildoj
 bildoj  bildoj  bildoj

I was cut by the end-mill when unscrewing the spindle nut that held it. The heavy spindle nut fell on my hand with the end-mill fixed to it. Be careful with sharp tools!

 bildoj

Fixing the cutting mill to the spindle.

 bildoj

The mill is now cutting the finished board

 bildoj  bildoj

Testing the continuity of the traces on board.

 plako fara

Unsuccessful milling


 bildoj  bildoj
 bildoj
 bildoj  bildoj
Video of the milling process

Finally a board is well cut

 bildoj
 bildoj  bildoj

Soldering the components

 bildoj  bildoj

The inventory...better late than never! :-D

 bildoj

The soldering station at Fablab Zoi has a heated air gun and a hot soldering tip stencil.

These are the instructions for the soldering station at Fablab Zoi.

Cleaning the solder gun.

 rezino luta

Testing the solder components.

 luti bone

Testing soldering SMDs (Surface Mount Devices).

 luti SMD

Placing solder on the board to set the MCU easily.

 bildoj  bildoj  bildoj  bildoj

Testing the LEDs for color and polarity.

 bildoj  bildoj

The soldered LEDs and resistor.

 bildoj

Soldered capacitor

 bildoj

Soldered resistor

 bildoj

Zenner

 bildoj

Other zenner. Notice it is too small to solder as designed.

 bildoj

Bending the header legs.

 bildoj

Soldering finished

 bildoj

Adding a glued piece of plastic to give the width needed for the USB bus connector.

 bildoj

Sanding the elevator piece.

 bildoj

The board USB connector now has a thickness to standard.

 bildoj

Cut the excess copper at the tip of the USB connector and added solder to the communication and power pads to make them gain volume.

 bildoj  bildoj

The light will not glow because the programmer's fuses have not been blow yet.

 bildoj

Programming the board

In order for the board to do anything, the MCU must have a program. In this case, the MCU must be able to program other boards. The appropriate program is then loaded.

Connect a functional In-System Programmer to the new ISP through 2x6 header pins. Make sure each pin is on the same connection on both boards.

 bildoj

Connect the functional ISP to the computer USB port.

 bildoj

Compiling and installing the firmware

In order to program the FabTinyISP, I followed the instructions at http://fabacademy.org/2018/docs/FabAcademy-Tutorials/week4_electronic_production/fabtinyisp_english.html

The first thing I did was downloading and decompressing the firmware. Then I compiled with make.

      make
      make flash
      make fuses
      make rstdisbl  
    

Transfering the firmware to the new board gave these results:

 bildoj

$ make flash avrdude -p attiny45 -c usbtiny -P usb -e \ -U flash:w:fts_firmware.hex avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9206 (probably t45) avrdude: erasing chip avrdude: reading input file "fts_firmware.hex" avrdude: input file fts_firmware.hex auto detected as Intel Hex avrdude: writing flash (2474 bytes): Writing | ################################################## | 100% 1.69s avrdude: 2474 bytes of flash written avrdude: verifying flash memory against fts_firmware.hex: avrdude: load data flash data from input file fts_firmware.hex: avrdude: input file fts_firmware.hex auto detected as Intel Hex avrdude: input file fts_firmware.hex contains 2474 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 2.65s avrdude: verifying ... avrdude: 2474 bytes of flash verified avrdude: safemode: Fuses OK (E:FF, H:DD, L:E1) avrdude done. Thank you.

So the device then is disconnected from the programmer and it is recognized by the usb port.

$ lsusb Bus 003 Device 012: ID 1781:0c9f Multiple Vendors USBtiny

make fuses

 bildoj
 bildoj

Blowing the fuses

I tried to reset the fuses without connecting the other board. I thought that it was already programmed and that it did not need the programmer any more. So I ran the command and had an error.

$ make rstdisbl avrdude -p attiny45 -c usbtiny -P usb \ -U lfuse:w:0xE1:m -U hfuse:w:0x5D:m \ -U efuse:w:0xFF:m avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check. avrdude done. Thank you. Makefile:70: recipe for target 'rstdisbl' failed make: *** [rstdisbl] Error 1

I reconnected the old programmer and then it would work correctly.

$ make rstdisbl avrdude -p attiny45 -c usbtiny -P usb \ -U lfuse:w:0xE1:m -U hfuse:w:0x5D:m \ -U efuse:w:0xFF:m avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9206 (probably t45) avrdude: reading input file "0xE1" avrdude: writing lfuse (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lfuse written avrdude: verifying lfuse memory against 0xE1: avrdude: load data lfuse data from input file 0xE1: avrdude: input file 0xE1 contains 1 bytes avrdude: reading on-chip lfuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of lfuse verified avrdude: reading input file "0x5D" avrdude: writing hfuse (1 bytes): Writing | ################################################## | 100% 0.02s avrdude: 1 bytes of hfuse written avrdude: verifying hfuse memory against 0x5D: avrdude: load data hfuse data from input file 0x5D: avrdude: input file 0x5D contains 1 bytes avrdude: reading on-chip hfuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of hfuse verified avrdude: reading input file "0xFF" avrdude: writing efuse (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of efuse written avrdude: verifying efuse memory against 0xFF: avrdude: load data efuse data from input file 0xFF: avrdude: input file 0xFF contains 1 bytes avrdude: reading on-chip efuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of efuse verified avrdude: safemode: Fuses OK (E:FF, H:5D, L:E1) avrdude done. Thank you.

So now it is has programmed the new board and reset the disable bit.

Ready to test the programmer

So now I disconnected Vcc from the reset pin. But that caused the USBtinyISP to disconnect Vcc from the LEDS and from FTDI and SPI connectors. So I re-soldered the connection. This is apparently a flaw in the board design.

Now I get a glowing light when connecting the board to the computer's USB port.

 bildoj

Conclusions

Making an In-System Programmer is an easy process once you know how to do it. It is a very useful piece of hardware.

The inside and outside colors of image file for the traces must be considered carefully in order for FabModules to make correct Gcode files out of them. There must be color on both sides of the traces and cuts. If not, they will not be done correctly.

Soldering is difficult at first. But you can start with larger package parts for startup ease. I have a trembling problem. But it was still possible for me to solder. Nevertheless, at first it took help and many hours of failure before acquiring the minimum necessary skill.

Care must be taken to work with sharp and hot tools. I cut myself with the bit and burned myself with the hot soldering stencil. They were not severe injuries. But they could be even deadly and it would be better to avoid these hazards.

Autoleveling of the table and a good quality end-mill are very important to get good PCB boards.

It is easier to use a very pointy (10°) end-mill for both milling and cutting. Then you do not waste time in changing end-mills.

Source files

Traces Cuts

Other photos