`

Electronics Production

I have some theoritical information on electronics that I acquired in my 1st year of engineering. I don't know how they work altough I have an idea what some of the component do.I do find it very interesting as I have a lot of projects that could benefit from some moving parts.I wrote down the start and end points (in mm) and started milling. Because milling just .1mm of copper the dust is minimal and the dustbuster was not nescessary all the time. Though we wanted to see what the machine was doing.

So I downloaded Brian's usb tiny circuit based on ATtiny44 as suggested by professor Neil I tried to understand how the circuit works with that attiny lower speed micro controllers

Details on Brian's USB Tiny Circuit From here

I downloaded the isp png traces and outline from links below

  • Traces (1000dpi)
  • Outline(1000dpi)
  • Then I Transfered the png in fabmodules.org in order to get .rml documents: Trace calculated in FabModules Outline calculated in FabModules

    After that I printed in Roland Mill with the helpof Classmates that normally use it: RolandMill Placing The tool into te machine Tracing Tool already placed settinng X,Y in Vpanel Tools used to print and outline Tool Tracing in RolandMill USB Done printing

    Then I identified all the components stated in the document and identified where there were supposed to be soldered,ten I soldered them as I have ad some practice before helping my team in soldering electronics components although the difference here is that the packages are SMD soldered on the Top surface

    Componets used

  • 1x ATtiny45
  • 2x 1Kohm resistors
  • 2x 499Kohm resistors
  • 2x 49Ohm resistors
  • 2x 3.3v Zener diodes
  • 1x red LED
  • 1x green LED
  • 1x 100 nF capacitor
  • 1x 2x3 pin header
  • As mentioned above I have some knowledge in soldering although the packages I used to solder are not SMD,The SMD packages are tiny and are soldered on the surface.,So I based my self on the details that are in Brian's link

    The details I based myself while soldering the components Soldering Soldered USB Tiny

    After the PCB was complete there was one more step to complete and that is to make the thing programmable. First I checked all the connections for electric shortcircuits using a multimeter and found out there were no short circuits. and then for programming it I had no idea where to start

    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 
    main.c:88:13: warning: always_inline function might not be inlinable [-Wattributes] 
     static void delay ( void ) 
                 ^ 
    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	   2002	      0	   2002	    7d2	main.hex 
    
    I had to setup fuse setting by typing
  • make fuse
  • and press enter, this is the result.
    avrdude -c stk500v1 -b19200 -P /dev/ttyACM0  -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m 
    
    avrdude: AVR device initialized and ready to accept instructions 
    
    Reading | ################################################## | 100% 0.02s 
    
    avrdude: Device signature = 0x1e9207 
    avrdude: reading input file "0xDF" 
    avrdude: writing hfuse (1 bytes): 
    
    Writing | ################################################## | 100% 0.01s 
    
    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.01s 
    
    avrdude: verifying ... 
    avrdude: 1 bytes of hfuse verified 
    avrdude: reading input file "0xFF" 
    avrdude: writing lfuse (1 bytes): 
    
    Writing | ################################################## | 100% 0.02s 
    
    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.01s 
    
    avrdude: verifying ... 
    avrdude: 1 bytes of lfuse verified 
    
    avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) 
    
    avrdude done.  Thank you. 
    

    type
  • make program
  • then this is the result of make program
    avrdude -c stk500v1 -b19200 -P /dev/ttyACM0  -p attiny44 -U flash:w:main.hex:i 
    
    avrdude: AVR device initialized and ready to accept instructions 
    
    Reading | ################################################## | 100% 0.02s 
    
    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 (2002 bytes): 
    
    Writing | ################################################## | 100% 2.88s 
    
    avrdude: 2002 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 2002 bytes 
    avrdude: reading on-chip flash data: 
    
    Reading | ################################################## | 100% 1.44s 
    
    avrdude: verifying ... 
    avrdude: 2002 bytes of flash verified 
    
    avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) 
    
    avrdude done.  Thank you. 
    
    avrdude -c stk500v1 -b19200 -P /dev/ttyACM0  -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m 
    
    avrdude: AVR device initialized and ready to accept instructions 
    
    Reading | ################################################## | 100% 0.02s 
    
    avrdude: Device signature = 0x1e9207 
    avrdude: reading input file "0xDF" 
    avrdude: writing hfuse (1 bytes): 
    
    Writing | ################################################## | 100% 0.01s 
    
    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.01s 
    
    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.01s 
    
    avrdude: verifying ... 
    avrdude: 1 bytes of lfuse verified 
    
    avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) 
    
    avrdude done.  Thank you.