Electronics production

This assignment I fabricated and programmed the FabTinyISP.

This tutorial building the FabTinyISP, help me to fabricate my FabISP. I took soldering iron, tweezers, lens, solder, components and a Modela MDX 40.

  • PCB Fabrication
  • I downloaded the PNG files for the traces, the board outline and the Fab modules to convert the files and send to a Modela MDX 40.

  • The Fab Module process
  • First I acess the Fab modules web site and upload the traces.

    Chose the machine Roland mill .rml as out put format and the tool PCB traces 1/64 to mill internal traces.

     

    To calculate the tool diameter:

    tg(15)=x/2 :2

    x = tg(15) x 2 x 0,2

    x = 0,1 mm tool diameter

    Then the main parameters are about the Modela machine, and we are using the cut deth 0.2mm tool diameter 0.1mm and number of offsets 8

     

    Then Calculate and Save and after this ...

    ... send to Modela software in our case is the Vpanel

  • PCB Fabrication
  • Soldering and organizing it
  • After the milling the PCB, I remove a bit of cooper note that It is important to do with care, I removed one board trace and lost one PCB milled.

    To organize the solder practice I separate the components in my noteboo, for more details see this tutorial building the FabTinyISP.

    Materials

    1x ATtiny45 2x 1kΩ resistors 2x 499Ω resistors 2x 49Ω resistors 2x 3.3v zener diodes 1x red LED 1x green LED 1x 100nF capacitor 1x 2x3 pin header.

    The soldering technique that I was using was inappropriate, and my tutor Kenzo Abiko. help me to not put solder in all board places (connections) before the component. To have better connections the advice is to put solder in half of components connections ("legs") and so, solder the other component´s ("legs"). The technique is so important to make the best board.

    The difficult is the ATtiny45, Zenner and the LEDs that need our attention about the orientation.The tip is that the Attiny (circle mark) and Zenner (line mark) have the same direction in the board" (see red mark).

    But I have "heavy hand solder" then I had to clean ( Isopropyl Alcohol) and sanding gently to have better connections in the USB computer. Thanks to my tutor Kenzo Abiko.

  • Programming the FabTinyISP
  • Installing Linux packages [avrdude gcc-avr avr-libc make]

                alex@alex-V5-171:~$ sudo su -
                root@alex-V5-171:~#  apt install avrdude gcc-avr avr-libc make
                Lendo listas de pacotes... Pronto
                Construindo árvore de dependências
                Lendo informação de estado... Pronto
                	

    Download the firmware files here

    Inside the 'fts_firmware_bdm_v1´ folder execute make to build the .hex file

                alex@alex-V5-171:~/... /fts_firmware_bdm_v1$ make
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char
                -funsigned-bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c main.c -o main.o
                main.c:109:13: warning: always_inline function might not be inlinable
                [-Wattributes]
                 static void delay ( void )
                             ^
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char
                -funsigned-bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c usbdrv/usbdrv.c
                -o usbdrv/usbdrv.o
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char -funsigned
                -bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c usbdrv/oddebug.c -o
                usbdrv/oddebug.o
                avr-gcc -x assembler-with-cpp -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -
                funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c
                usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
                avr-gcc -mmcu=attiny45 -o fts_firmware.elf main.o usbdrv/usbdrv.o usbdrv/
                oddebug.o usbdrv/usbdrvasm.o
                avr-size -C --mcu=attiny45 fts_firmware.elf
                AVR Memory Usage
                ----------------
                Device: attiny45
    
                Program:    2488 bytes (60.7% Full)
                (.text + .data + .bootloader)
    
                Data:         75 bytes (29.3% Full)
                (.data + .bss + .noinit)
    
    
                avr-objcopy -j .text -j .data -O ihex fts_firmware.elf fts_firmware.hex
                

    Checking the 'fts_firmware_bdm_v1´ folder and there is the .hex file

                alex@alex-V5-171:~/.. ./fts_firmware_bdm_v1$ ls
                fts_firmware.elf  main.c  Makefile     usbdrv
                fts_firmware.hex  main.o  usbconfig.h
                

    Edit the 'makefile' to your AVR programmer see this tutorial

    As 'root' do make clean to remove all autogenerated files.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make clean
                rm -f usbdrv/*.o
                rm -f *.hex *.elf *.o
                

    As 'root' do make flash that uses the programmer to load it onto the target chip.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make flash
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char -funsigned-
                bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c main.c -o main.o
                main.c:109:13: warning: always_inline function might not be inlinable
                [-Wattributes]
                 static void delay ( void )
                	             ^
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char -funsigned
                -bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c usbdrv/usbdrv.c -o usbdrv
                /usbdrv.o
                avr-gcc -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I. -funsigned-char -funsigned-
                bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c usbdrv/oddebug.c -o usbdrv
                /oddebug.o
                avr-gcc -x assembler-with-cpp -mmcu=attiny45 -Wall -DF_CPU=16500000UL -I.
                -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Os -Iusbdrv -c
                 usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
                avr-gcc -mmcu=attiny45 -o fts_firmware.elf main.o usbdrv/usbdrv.o usbdrv/oddebug
                .o usbdrv/usbdrvasm.o
                avr-size -C --mcu=attiny45 fts_firmware.elf
                AVR Memory Usage
                ----------------
                Device: attiny45
    
                Program:    2488 bytes (60.7% Full)
                (.text + .data + .bootloader)
    
                Data:         75 bytes (29.3% Full)
                (.data + .bss + .noinit)
    
                avr-objcopy -j .text -j .data -O ihex fts_firmware.elf fts_firmware.hex
                avrdude -p attiny45 -c avrisp2 -P usb -e \
                	-U flash:w:fts_firmware.hex
                avrdude: AVR device initialized and ready to accept instructions
    
                Reading | ################################################## | 100% 0.00s
    
                avrdude: Device signature = 0x1e9206
                avrdude: erasing chip
                avrdude: reading input file "fts_firmware.hex"
                avrdude: input file fts_firmware.hex auto detected as Intel Hex
                avrdude: writing flash (2488 bytes):
    
                Writing | ################################################## | 100% 0.86s
    
                avrdude: 2488 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 2488 bytes
                avrdude: reading on-chip flash data:
    
                Reading | ################################################## | 100% 0.74s
    
                avrdude: verifying ...
                avrdude: 2488 bytes of flash verified
    
                avrdude: safemode: Fuses OK (H:FF, E:DF, L:62)
    
                avrdude done.  Thank you.
                

    As 'root' do make clean to remove all autogenerated files.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make clean
                rm -f usbdrv/*.o
                rm -f *.hex *.elf *.o
                

    As 'root' do make fuses that programs the fuse bits on the target chip.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make fuses
                avrdude -p attiny45 -c avrisp2 -P usb \
                -U lfuse:w:0xE1:m -U hfuse:w:0xDD:m \
                -U efuse:w:0xFF:m
    
                avrdude: AVR device initialized and ready to accept instructions
    
                Reading | ################################################## | 100% 0.00s
    
                avrdude: Device signature = 0x1e9206
                avrdude: reading input file "0xE1"
                avrdude: writing lfuse (1 bytes):
    
                Writing | ################################################## | 100% 0.01s
    
                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 "0xDD"
                avrdude: writing hfuse (1 bytes):
    
                Writing | ################################################## | 100% 0.01s
    
                avrdude: 1 bytes of hfuse written
                avrdude: verifying hfuse memory against 0xDD:
                avrdude: load data hfuse data from input file 0xDD:
                avrdude: input file 0xDD 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 (H:FF, E:DD, L:E1)
    
                avrdude done.  Thank you.
    
                

    As 'root' do make rstdisbl to blow the reset fuse.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make rstdisbl
                avrdude -p attiny45 -c avrisp2 -P usb \
                		-U lfuse:w:0xE1:m -U hfuse:w:0x5D:m \
                		-U efuse:w:0xFF:m
                avrdude: usbdev_open(): did not find any USB device "usb"
                make: ** [rstdisbl] Erro 1
                

    Here, I had several error connections that made me to connect and disconnect the FabISP and put a tape at its base to thicken it

    And again make rstdisbl

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make rstdisbl
                avrdude -p attiny45 -c avrisp2 -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.00s
    
                avrdude: Device signature = 0x1e9206
                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.01s
    
                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 (H:FF, E:5D, L:E1)
    
                avrdude done.  Thank you.
                

    As 'root' do make clean to remove all autogenerated files.

                root@alex-V5-171:/.../fts_firmware_bdm_v1# make clean
                rm -f usbdrv/*.o
                rm -f *.hex *.elf *.o
                	

    As 'root' let's see If the FabISP is connected on USB as Multiple Vendors USBtiny .

                root@alex-V5-171:/.../fts_firmware_bdm_v1# lsusb
                Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
                Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
                Bus 001 Device 003: ID 04f2:b336 Chicony Electronics Co., Ltd
                Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
                Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
                Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
                Bus 003 Device 080: ID 1781:0c9f Multiple Vendors USBtiny
                

  • What works and what not in this assignment?
  • After tested several times without sucess, my tutor Kenzo told me to reinforce the FabISP base with a tape to a better connection with the computer. After that, it was connected better with USB computer and was programmmed.