Here are the sources to the tools I used for my creating my Tiny45 programmer.
EAGLE is another Autodesk Software. This tool is an all in one tool for creating pcbs on your own with a massive library of electronic parts that is extendable by downloading part libraries from the internet.
The ProMat S103 is a pcb plotter from LPKF for rapid prototyping. It is a 2.5D CNC for milling very small circuits into a copper plates to produce pcbs on your own.
This week we should produce our first own pcb board. At our FabLab we have a circuit board plotter from LPKF that we will use to plot the programmer we develop. We are also using EAGLE because it is the software that works best with our plotter.
After installing EAGLE on my Macbook I start EAGLE 8.0.1 and had to login into my Autodesk account. These are the same credentials I used for Fusion360. After firing up the software I created a new project that stores my circuit schematic and board layout.
I needed an additional pin-header to connect the external programmer to the AtTiny. Everything I found the the EAGLE library where non SMD parts. Because I wanted to rely on SMD party only, I hat to search the Internet to find a library that has the missing part in it. Dr azzy's Website has a library with all the SMD pin-header. First I had to add the library to EAGLE I had to extract the archive. After that I moved the .lbr file into EAGLE's lbr directory. To let EAGLE know that it should use this library I additional hat to update the library list under library->update
all and then go to library->use
. Here now appears the new added library and I it. From now on I could use the parts in it from the edit->add
menu.
For my design I oriented me on the work of Brians programmer that was based on Zaercs programmer from FabAcademy 2015. We altered the design because we want to use a USB-AB port instead of the USB drive like connection.
After adding all the necessary components to the schematics I had to add all the lines between them to give them a physical connection with a copper line when designing the board. To make it easier to create the schematics and to avoid adding the same component multiple times for example the VCC (positive supply voltage) or the GND (ground) you can add names to the lines. This is done by selecting the name tool and then select the line. When give two lines the same name, they will automatically connect in the board design.
As you can see, this schematic of the programmer is very similar with Brians version, so thanks again for that. Next step is to layout the board and create all the routes to connect the parts. To change to the board layout view press the button as shown in the image below.
When entering the board layout the first time all the parts are over each other. First step is to move all the parts far away from each other to see the yellow lines that connect the parts. Second step is to sort the parts so that there are as few crossing lines as possible. After that rotate the parts to face as much connections towards to their destination.
When all the parts are ordered and they are best places in dependency to each other the parts finally can be routed. Whoever I asked told me that it is the best to set the routed by hand and not use the autoroute functionality. Because I also want to lear the process I do my best and draw all the routes by hand and try to have an equal space between the routes and the parts. There where some tricky parts where I hat to route unter the AtTiny and between the legs of the pin connector but our plotter should handle that fine routes.
Next trick my instructor Tobias told me was the most important one for this week I think. He told me about the rastnest functionality. Similar to the equal naming of lines in the schematics view there is a function in the board layout where you have the possibility to connect one signal to all the copper area that is between all parts on the board. It is a good practice to use the GND signal because it should stabilize the circuit and half of the contacts are GND. Because of that a whole bunch of contacts can be ignored when drawing the routes. To use the rastnest functionality you have to draw a rect around the whole circuit, set the 'Name' of the rect to GND and press the rastnest button. The result can be seen in the images below.
When the design is finished there is always space for improving it. What I don't liked on the design is that the led's are not beside each other. Thats why I moved some parts around and find a way to place them next to each other. During the update process I even improved the size of the board that it became smaller.
After a review if my design from my instructor, he pointed three major problems out.
So I redesigned the board and fixed the issues as you can see in the images below. By the way, the smaller and fewer resistors made the board even smaller.
This is the final layout that I will try to mill.
Feel free to try it for yourself. I added all the generated files below.
EAGLE project archive with schematics and board design | download |
board as image | download |
Qty | Value | Device | Package | Parts | Description | |
2 | LEDSMT1206 | 1206 | LED1, LED2 | LED | ||
4 | R-EU_R1206 | R1206 | R1, R2, R4, R5 | RESISTOR, European symbol | ||
1 | SJW | SJW | J1 | SMD solder JUMPER | ||
1 | 1.5k | R-EU_R1206 | R1206 | R3 | RESISTOR, European symbol | |
1 | 100nf | C-EUC1206 | C1206 | C1 | CAPACITOR, European symbol | |
2 | 3.3 | DIODE-MINIMELF | MINIMELF | D1, D2 | DIODE | |
1 | ATTINY45 | ATTINY45 | SOIC8 | ATMEL | ||
1 | Header 3X2 | PINHD-2X3SMT | 2X03_SMT | ISP | PIN HEADER | |
1 | MINI-USB-32005-201 | MINI-USB-32005-201 | 32005-201 | USB-AB | MINI USB-B Conector |
It's time to export the files from EAGLE to get the design into the Mill software.
Here you can download the LPKF cam configuration also the ready to import files for the LPKF software. To do so you click in EAGLE in the CAM processor image in the top toolbar. The images above show the steps to take to export machine files from EAGLE. You have to load a Job. This is some kind of confusing but this means in general to load a configuration how to export files. In a .cam file are all the configurations what is the electronic mill capable off. You can get the .cam file for our LPKF machine in the download section below.
LPKF cam export job for EAGLE export | download |
ready to mill files (zip) | download |
The files EAGLE will export are all the different layers of the PCB with the file extensions BOA, BOT, DRD, SMB, SMT, SPT, SSTand TOP.
In the LPKF software the first step is to import the files we exported from EAGLE.
Next comes the PCB milling. The last step in the LPKF suit the the production assistant. After accepting the configuration made before the assistant checks if all the tools needed to mill the design are present in the tool changer. If not you are able to select alternative tools for a specific task or add the needed tool to the set. Next you can choose how the the routes are milled. To make soldering easier I selected double routes. With this option selected the mill will double the trace width that are milled away from the copper board. This makes soldering easier and you have a better chance that there are no unwanted connections on a not perfectly milled trace. On this step of the assistant you can also select how your pcb is cut out. You have the option the cut it out total or left small bridges to break out the board. Because I have a small board it is no problem to cut it totally so I am able to take my pcb faster.
The last step is to place the tool material. This is the step where you set the X/Y null position of the mill head. I placed it on a free space and started the job.
Now you can lean back and watch the machine milling your pcb but be ready to lift the lid when you think that the machine maybe will or had made a crash. When lifting the lid enable the emergency stop of the machine.
On my design everything went fine.
The image below is taken during a tool change. The video is a time lapse of the whole process.
When the board is milled its time to place the solder paste onto the pads where the parts should be placed. The paste is like a paste but become a solid connection when heat up in the oven. Once all the pads are covered with enough solder, the parts can be added. Because we use small 1206 parts, a placement by hand should be very complicated. Because of that we are using a LPKF ProtoPlace S. This is a semi automatic pick & place system. It works with a vacuum tip and a guiding system to make placement of small parts easy.
It takes some time so feel comfortable to with the placer.
We are also using the LPKF PCB oven for soldering our boards. It has a heating program to heat up the board in a specific profile. The oven has different profiles for different board sizes. We where using the medium heating profile. After round about two minutes the parts was connected and we can began soldering the 2x3 pin header manually.
With the fresh baked board and the additional parts we added by hand because they where not smd, the board was ready to be connected to the mac for programming.
As pointed out in the documentation of Brian I downloaded and installed Cross Pack to add the option to communicate, read and write the Atmel chips from my mac.
With the chip hooked up to the ARV programmer I everything was prepared to flash the chip. First I had to edit the Makefile. I searched for the line where the programmer could be set.
PROGRAMMER ?= avrisp2
Here I alter the line to avrisp2. This is the transparent blue box from AVR from the previous image. There are several possible programmers but this box was what we have in the FabLab. This change is all what is to do for this project. Next step is to set the fuses on the chip. This can be accomplished by entering make fuses
.
Florians-MBP:fts_firmware_bdm_v1 florian$ 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.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 "0xDD"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.00s
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.
After setting the fuses of the AtTiny I flashed the program onto it. You start the flash progress with make flash
in the console.
Florians-MBP:fts_firmware_bdm_v1 florian$ make flash
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.75s
avrdude: verifying ...
avrdude: 2488 bytes of flash verified
avrdude: safemode: Fuses OK (H:FF, E:DD, L:E1)
avrdude done. Thank you.
The avrdude first flash the program to the chip and read it back again after that to verify that the chip was flashed successful. We first have some bad contacts on the pcs's pinheader. This caused avrdude to give some errors at this point, because the reading from the chip didn't match the source program. So after fixing the contact the flash process worked fine.
This is the final result for this week. The board we created does what It should at the end. After some connection fixes the board was programmable from my mac. In the end it was not recognized from my Mac because of the strange USB implementation that the Mac not accepted but Windows 7 recognized it as 'unknown device'.