Week-4 :-Electronics production

This week, I am going to make FAb IAP programmer. This ISP includes a few extra features such as a target power led and switch, a reset button and a led on the SCK line to indicate communication in progress. In-system programming (ISP), also called In-Circuit Serial Programming (ICSP). This device helps us to program a device while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system.


The PCB for ISP programmer can be machined using Modela MDX-20 3D Milling Machine. The Modela is an easy to use desktop milling machine, making it ideal for the rapid prototyping of product designs. In the FabLab, this is used for the milling of custom circuit boards, jewellery making and the production of moulds. The Modela can be used on wood, mdf, modeling wax, plaster and copper clad boards.

There are neumerous PCB designing softwares like Allegro, Altium, Board station, CADstar, CR-5000, Eagle, Expeditions, Freeware, OrCAD, NI Ultiboard, Pads, PCAD, Protel, Proteus. Since autodesk acquires eagle software, we are slowely switching to KiCAD software. The input required for modella miling machine is png file. A few software can directly export schematics to png format. The PCB for FabISP is shown below and the same can be downloaded here.


The above png file is imported to fab module. Fab module can be opened by entering 'fab' (pre installed) in the terminal window. After importing, the milling tool (1/64" dia) is selected for milling operation. The diameter of the tool is visible in the cutting parameter location. Each of the items is decribed below:-
  • Tool diameter :- Diameter of the milling tool (0.4mm for 1/64" bit) and for the cutting tool (0.8mm for 1/32" bit).
  • Offset :- This is the number of tool path around a track. -1 for complete removal of unwanted tracks.
  • Overlap :- It defines the merging of tool path. Idelly it is slightly smaller than tool diameter for the best result.
  • Z :- Its the depth of cut, ideally 0.08 mm to 0.1 mm for copper clad sheets.
    The copper clad board is sticked to the table bed using double sided tape. Initially the tool is set at extreme corner using X,Y cordinate values. After setting optimum position, the Z cordinate is set to zero. The next step is to click make.rml and click send.


    Once after milling process, PCB surface is wiped. If required Isopropyl alcohol can be used. The components for ISP is listed down. The standard soldering temperature is 700F, however 650F is found to be adequate for the eutectic mixture.

    We can programm a chip using different tools. The ATtiny45 chip need to be flashed inorder to work as ISP. The simplest method I opted is to programm the chip using arduino. We do have a arduino uno board. I have used Atmega328 chip and it have got superior properties over Atmega8 here in this project. The FabISP can be connected to arduino uno board using FRC cable (6 wires), and its corresponding pins are shown below.



    Turn arduino into an ISP

    Arduino Uno board contain an ISP and ATMEGA chip. AtMEGA chip offers input output terminals. An FRC cable is connected between ATtiny45 and arduino pins. Arduino Uno board is connected to computer and run the Arduino IDE program.


  • Select TOOLS>BOARD>ARDUINO UNO.
  • Select TOOLS>PORT>/dev/ttyACM0.
  • Select FILES>EXAMPLES>ARDUINO ISP>ARDUINO ISP.
  • Click UPLOAD.

    Now the program is uploaded to ATMEGA chip in arduino uno board. The blinking LED's indicate the program is being flashed. If the program return an error "permission denied", then open a terminal window and enter the command as follows. This command will give permission for the same device. This command should be executed each time the device is plugged in or else you should add udev rules in linux which will get executed automatically each time when the system boots. You can close arduino IDE program if required. If you disconnect your board accidently, make sure its the same device (ttyACM0) when you reconnect or else give the command according to the device name.

    sudo chmod a+rw /dev/ttyACM0

    The next task is burning fuses in ATtiny45 chip. The fuses determine how the chip will act, whether it has a bootloader, what speed and voltage it likes to run at, etc. The fuses given in the below comand is hexadecimal representation. (lfuse:w:0xe1:m hfuse:w:0xdd:m efuse:w:0xff:m). This hexadecimal representation is elobrated in the left picture below and the command for burning fuses is shown below.

    avrdude -c stk500v1 -P /dev/ttyACM0 -b 19200 -p t45 -V -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xff:m 


    The program for ISP needed to be compiled and installed. 'Make' and 'make install' commands are used for this purpose. A makefile is a file containing a set of directives used with the make build automation tool. Each compilation produces an object file corresponding to the source file, this source file is installed using "make install" command. The commands 'make' and 'make install' is shown below. This command to be run from the same folder where files are copied. The files for compiling can be downloaded here.


    If you made any mistake while compiling, you can undo the operation using the below commands.
        make clean
        make distclean
    


    Once after loading, the ATiny44 can be disconnected from arduino uno. Now plug it on USB. Open terminal window and enter 'lsusb' and look for the device ID 1781:0c9f - USBtiny. If USBtiny is detected, then ATtiny45 is working as ISP.

    lsusb

    The next step is Blowing the reset-disable fuse. Make sure everything is working properly before taking this final step. Enter the below command on a terminal window.

    avrdude -c tk500v1 -P /dev/ttyACM0 -b 19200 -p t45 -V -U lfuse:w:0xe1:m -U hfuse:w:0x5d:m -U efuse:w:0xff:m



    Now we got a working FabISP. I applied some hot glue over the components to protect it from accidental shortage, and to disperses the LED light effectively.
    It is recommended to connect this USB through an extension cable.
    The PCB for this project and its compiling files are available for download in this same page above.