WEEK5 : Electronic production

Fab ISP

fabisp

Resources

Tutorials

Teaching Materials

Assignment

group:

individual:

Group work

Asignment

Fabacademy official test pattern

We tried milling test pattern offered in fabacademy official page (link) and found out the capacity of our environment.

For the line thickness, 0.22mm was the minimum thickness that our milling machine (with best condition) can mill.
0.4mm was the minimum for the gap between lines. (as the diameter of the bit used was 1/64 inch = 0.396875mm)

See more info on group page.

Leveling sacrifice wood

Ensuring flat surface in the beginning is significantly important to get accuracy on milling. To do this, you first need to slightly shave the top of the wood.

Procedure is covered in group page, also on this article below.

Preparing data for milling

Get Fab ISP board design data from Archive Fabacademy 2018 week5

hello.ISP.44.res.cad

making rml data with mods

make “Trace”(circuit) rml data

go to mods

Programms > open server programm > SRM-20 > PCB
mods first screen

load png file to process

Read png > select png

add module to save

modules > file > save
connect to “Roland SRM-20 milling machine”
->click output then click input in save file
enter image description here

adjust parameters

Roland SRM-20 milling machine > origin
set x, y, z all to 0.
enter image description here

Calculate

mill raster 2D > calculate
rml file will be saved automaticaly

Check rml data

open exported rml and see last line.
If the line in the end of exported rml looked like this, it is an error try again.

PA;PA;!PZ0,NaN;PUNaN,NaN;!MC0;

Make “Interior”(outline) rml data

Change following setting.
set PCB defaults >

Hands-on milling with SRM-20

materials

enter image description here

Milling with SRM-20

I. Process “trace”

Open Vpanel for SRM-20

Set origin(原点合わせ)

  1. Move bit to the point you want to start milling.
    Use the console in Vpanel. Be precise for x and y (horizontal) direction, for z stop few millimeters above the origin point.
    enter image description here
  2. Then drop the bit manually.
  3. set origin
    In Vpanel interface(原点指定), push x/y and z button to set origin.
    enter image description here

Start processing

  1. press process(加工)button and lunch window.
    enter image description here
  2. Remove every thing in the list.
  3. Then add file you want to process (“trace” file).
  4. press output(出力)

II. Process"interior"

  1. Change bit to 1/32 inch
  2. enter image description here
  3. Re-adjust z origin point
    Always adjust z origin when you change bits.
    * Be careful not to move xy origin.
  4. process

III. Finish

  1. Remove dust with brush
    enter image description here
  2. Pour solvent in to the milled pit, use scraber to peal it off.
    enter image description here
  3. Fillet corners with paper cutter
    enter image description here
  4. Remove a flash with steal wool
    enter image description here
  5. Shave unnecessary part using ultrasonic cutter
    enter image description here

Soldering

Material

enter image description here

Parts

enter image description here

R1: Resistance 1k ohm (1000) x 1
R2: Resistance 499 ohm (4990) x 1
R3,R4: Resistance 100 ohm (101) x 2
R5: Resistance 10k ohm (1002) x 1
C1: Capacitor 1uF x 1
D1,D2: Zener diode 3.3V x 2
IC1: Attiny 44 x 1
20MHz: Resonator 20MHz x 1
SJ1,SJ2: Wire x 2
J1 ISP: Pin header 2x3 x 1
J2 USB: USB jack

Soldering iron use

T18-B2 (2mm) : USB jack and 2x3pin header
T18-C1 (1mm) : other parts

Process

  1. Coat with flux
    First of all, coat your board with flux right away before its surface get oxidized. Let it dry for a hour.
    enter image description here

  2. Start placing and soldering from USB socket
    It will be difficult to place after you have other parts on the board as they block the soldering iron.

  3. Solder SPU
    *Careful with the direction! Small dot indicates pin1 (which is VCC pin in Attiny44A refer to the datasheet)
    attiny44a

  4. Solder resisters, capacitors and diodes

  5. Place crystal

  6. Place 2x3pin header
    enter image description here

enter image description here

Basic rules for soldering

Programming

Resources

You will need

Steps

Follow the instruction in the tutorial above.

  1. Get all softwares downloaded on the laptop
  1. Wire up
    Wiring
    Wire up Fab ISP and programmer with PC.
    * Be careful for the direction of 6 pin connector. The red wire should go to V pin.
    Board
    *(ATAVRISP2) Programmer Light Indicator Messages
  1. In terminal, go to unziped firmware directory.
    for example:
    $ cd ~/Desktop/fabISP_mac.0.8.2_firmware

  2. Make changes on makefile (you can find it in firmware you downloaded) depends on which programmer you are going to use: other programmer, other FabISP programmer or Arduino.

The line in makefile you need to edit.

#AVRDUDE = avrdude -c usbtiny -p $(DEVICE) # edit this line for your programmer  
AVRDUDE = avrdude -c avrisp2 -P usb -p $(DEVICE) # edit this line for your programmer

if you are using arduino:

AVRDUDE = avrdude -c stk500v1 -b19200 -P /dev/cu.usbmodem1421 -p $(DEVICE)
  1. Compile firmware

    $ make clean

If successful, you will get following response…

naitoukainoMacBook-Pro:kai-naito kai$ cd ~/desktop/firmware
$ make clean
rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex 
main.elf *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s

Then,

$ make hex

You will get this if the process succeeded.

naitoukainoMacBook-Pro:firmware kai$ make hex
avr-gcc -Wall -Os -DF_CPU=20000000	 -Iusbdrv -I. -DDEBUG_LEVEL=0 
-mmcu=attiny44 -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
avr-gcc -Wall -Os -DF_CPU=20000000	 -Iusbdrv -I. -DDEBUG_LEVEL=0 
-mmcu=attiny44 -x assembler-with-cpp -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
avr-gcc -Wall -Os -DF_CPU=20000000	 -Iusbdrv -I. -DDEBUG_LEVEL=0 
-mmcu=attiny44 -c usbdrv/oddebug.c -o usbdrv/oddebug.o
avr-gcc -Wall -Os -DF_CPU=20000000	 -Iusbdrv -I. -DDEBUG_LEVEL=0 
-mmcu=attiny44 -c main.c -o main.o
avr-gcc -Wall -Os -DF_CPU=20000000	 -Iusbdrv -I. -DDEBUG_LEVEL=0 
-mmcu=attiny44 -o main.elf usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o 
main.o
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
avr-size main.hex
   text	   data	    bss	    dec	    hex	filename
      0	   2020	      0	   2020	    7e4	main.hex 
  1. Set ISP to use the external clock (crystal)

Type

$ make fuse

on terminal, then you will get

You should get this feedback from the system

naitoukainoMacBook-Pro:firmware kai$ sudo make fuse
avrdude -c usbtiny -p attiny44  -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9207
avrdude: reading input file "0xDF"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDF:
avrdude: load data hfuse data from input file 0xDF:
avrdude: input file 0xDF 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 lfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

if successful.

  1. Program the board to be an ISP programmer.
    Type
$ make program

You should get following respond.

naitoukainoMacBook-Pro:firmware kai$ sudo make program
password:
avrdude -c usbtiny -p attiny44  -U flash:w:main.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9207
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: writing flash (2020 bytes):

Writing | ################################################## | 100% 5.68s



avrdude: 2020 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex contains 2020 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.36s



avrdude: verifying ...
avrdude: 2020 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

avrdude -c usbtiny -p attiny44  -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9207
avrdude: reading input file "0xDF"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDF:
avrdude: load data hfuse data from input file 0xDF:
avrdude: input file 0xDF 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 lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Done!

Enabling as a programmer

You need to remove jumper wires to enable the board as a programmer. Take away 0 ohm resister and the solder bridge indicated as “SJ” in the board diagram.
enter image description here


Now FabISP could be used as a programmer.

Check whether FabISP is recognized in MacOS.
Mac > About this Mac > System report

You can see FabISP under USB port if your FabISP is recognized.

Trouble shooting

I succeeded to get rid of this by establishing path through.
Here is useful reference for making path…Qiita

Making connector

Make 6pin head connector we will be using from next week. Will use it to wire Fab ISP(programmer) and IC to write program in.

Insert wires in the right position.
enter image description here

Squeeze it with a cramp to fix wire.
enter image description here

Put a cap on to bend wire 180deg.
Done.
enter image description here