Week 5. Electronics Production

Go to:
  1. Group Assignment
  2. Making an in-circuit programmer
  3. Programming
  4. Shell
  5. Results

Group Assignment

Characterize the design rules for your PCB production process

This week is dedicated to PCB fabrication by using milling processes. I was exploring it with:

This week we used Roland SRM-20 milling machine. From the software we can control x,y,z position of the drill and rotating speed. Before starting tests we cleaned the machine properly and made sure that the working surface is flat. Then we downloaded Linetest.png file and using mods we made a .rml file for the milling machine.

Roland SRM-20

Mods

To open this program go to mods then right click on the window and select: programs/open server program/SRM-20(PCB). And we want to save file, not send it to the machine, so delete WebSocket device module and right click on the window and select: modules/open server module/file (save). Then set origin coordinates to (0,0,0) and connect output Roland SRM-20 milling machine and input save file. Open your png file in read png module. Click on mill traces 2D or mill outline in set PCB deafauls. Then define tool diameter and cut depth in mill raster 2D module and press calculate. testlines.png.rml file will be downloaded automatically (this file you should open in the milling machine software). Click view button to check if the created path is correct.

Drills we used

0.5mm 0.4mm 0.2-0.5mm 0.1mm

The plate we used was bended so we cut a smaller piece

Double sided tape on the back side

V-panel is the software to operate the machine.

First step is to set the origin point. X,Y and Z buttons (marked with a red rectangle) will move the jog by 1mm, 0.1mm or 0,01mm depending on the chosen step. Continuous mode will move the jog while the button is pressed. FabLab tutors strong recommendation is NOT to use it moving along the Z-axis. So, move the jog to the left-bottom corner of the material, set the X,Y starting point (X/Y button in the green rectangle) then move it down along the Z-axis until it will be less than 1mm to the surface. Then you can loose the clutch and carefully drop the milling bit to the surface. Don't forget to tighten the clutch after. Define that point as zero-Z. I like to define the zero Z point a little bit higher than the surface and start the job. That way I can see if the stock plate is not plane enogh and I can fix it with no harm done. View button will move the platform forward so you can take a look how it's going. After all zero-points are defined press Cut and choose a .rml file. When you press Output the job will start immideately. At every point of the job you can Pause, move to the view position, take a look and continue or cancel the process.

Simplified procedure of fabrication/milling process of PCBs:

Limitations

We did a few test cuts

So far no problems occurred. However, there must be something, which is stopping us from creating ultra-small circuits. Something, which prevents from unbelievably precise PCBs. Unfortunately there is couple things. First of all drill size is somewhat limiting us in the milling. Second case is step of motors, this is also not finite and have some strict values. Nevertheless it is usually smaller than used drill and third factor. Even that we are using really small drill sizes, when drill routes are close to each other they will rip copper from the surface. Leaving nothing but an empty hole. We created a test drill to estimate couple constants

Drill_1: 0.2 - 0.05 [mm] 90 degree milling tip

How close traces may be placed:size of drill head
What is minimal width of a trace:0.001 mm
What is ability to drill between traces: till 0.01 mm
ResultDrillSize/Shape
0.2 - 0.05 [mm]
V-shape

Drill_2: 0.4 [mm] flat milling tip

How close traces may be placed:size of drill head
What is minimal width of a trace:0.001 mm
What is ability to drill between traces: till 0.4mm mm
ResultDrillSize/Shape
0,4 [mm]
Flat

2. Making an in-circuit programmer

To make it fast and right I followed Brians tutorial.

I cut a small piece of the material and put double side tape on it.

Then I downloaded:

And using mods I created .rml file for the traces and for outline. To mill my board I used 0,2-0,5 mm V-shape milling bit for Traces and 1mm flat — for Outline. I saved .rml files. With V-panel I set the origin. Then I pressedCut, removed previous files from the queue and added my file

Removed excess material with a knife

Brian's schematic

Components list:

I soldered the components from center to the edges, from complicated (ATTINY) to easy ones (like pin header). To allign the component I put some solder on the pad, then I solder one contact of the component to this pad, allign it properly and then I solder all other contacts of the component. The main thing here is the solderin iron. The thiner the tip is the easyer it is to solder small components.
Red dot is the mark on the ATTINY.
Behind the pin header the removed bridge is visible. It temporarily connects VCC to the Vprog pin on the ISP header so that the header can be used to program the tiny45. It must be removed after the programming is finished

LEDs have green line on the cathode side.

Zender Diodes have a mark on the cathode side as well. This is the correct way to place them.

3. Programming

Mikko Toivonen helped me to program my programmer using his programmer. Most likely, it is better to do the programming part from Linux (just follow the tutorial on this page), but my laptop with Linux Mint onboard went to his digital Valhalla so here's tutorial for Windows. It is based on this tutorial and Kati's documentation for this week from previous year. I walked through the process and made the screenshots by myself, but, since I have my programmer already programmed, I couldn't complete two final steps. By all meanings it must work just fine.

Installations for setting up the development environmen

1) First of all, Install the Atmel AVR Toolchain for Windows from Atmel's site and ran the installer. Pay attention to extract the files to C:\Program Files.

2) Next, download Gnu Make and launch the installer. Accept the default location for the installation, which seemed to be C:\Program Files (x86)\GnuWin32.

3) Download avrdude, unzipp the folder and copy the archive 'avrude' inside of it to C:\Program Files.

For finishing these tool installations, modify the Paths in order to tell Windows the locations of the tools. Go to Control Panel/System

Click on Advanced system settings

Click on Environment Variables...

In System variables edit (or create new if needed) variable PATH

This window can look different on later version of Windows

Paste in the Variable value paths to the tools using ";" as a divider:

This is how it should look like:
C:\Program Files\avr8-gnu-toolchain\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files\avrdude;
Don't forget to save changes (OK→OK→OK). If something goes wrong check this tutorial.

4) Next step and as a last part of the installations, was to install drivers for my programmer. For Windows users, Brian advices us to use a helpful tool Zadig. On this step you need to borrow already working programmer from somebody. Plug it to usb 2.0 port and start the install the driver.

Checking the installations and commands to make sure everything works

In order to check that everything are in the right folders and installations are finished successfully, I used Git Bash for Windows, but Command prompt must work as well

Type next commands in terminal and press Enter. If you get a "command not found" error instead, re-check your installations.

make -v
avr-gcc --version
avrdude -c usbtiny -p t45        

You must get something like that. If not - check installations and paths in the Environment Variables

Building the Firmware

Downloaded the firmware source code and extract the zip file. In Git Bash, navigate into the source code directory, and ran make. The command builds the fts_firmware.hex -file

make

Programming the ATtiny45

Plug your board and the programmer you use to the USB 2.0 ports (extension cables are recommended). Red LED on your board must shine now. Then connect ISP headers via cable. Be careful with the pin layout. I usually look at the GND pin position.
Run make, which erase the target chip, and program its flash memory with the contents of the fts_firmware.hex -file. From the processes below can be seen how avrdude erased (erasing chip), programmed (writing flash), and verified (verifying flash memory against fts_firmware.hex) the chip.

make flash

After programming the flash memory, set the configuration fuses. The fuses control where the microcontroller gets its clock source from.
[Also, after making sure that the board has succesfully programmed to be a programmer, the fuse disabling the reset pin and turning it into a regular GPIO in will be set. This allows the chip use the reset pin for programming other boards, but will disable the ability for this chip to be reprogrammed.]

make fuses

Now you board must be visible in the Device manager.

The ATtiny45 on the board must have the code loaded onto it, and the FabTinyISP microcontroller must be programmed. The original program memory is re-programmed, and the new program is stored in non-volatile memory meaning that ATtiny45V will remember the program.

Blowing the Reset Fuse

Two steps left.
Turne the ATtiny45's reset pin into a GPIO pin by finishing the fuses using make rstdisbl command, which does the same as the 'make fuses' did before, but adds that final command disabling the ability to reprogram this chip anymore.

make rstdisbl

*Image from the internet

Final step is to disconnect the Vcc from the Vprog pin on the ISP header by removing the temporarily jumper (on the schematic marked as J1). Heat it with the soldering iron and remove the solder with a solder removing tool or a piece of a wire braid.

Removed jumper

4. Shell

This part I did later than the rest of the documentation, but it belongs here. The programmer does not fit in the USB port. So it needed a nice case. I designed it in Fusion360 and printed it on Fromlabs Form2. I'm very satisfied with it.

It seems you are using an outdated browser that does not support canvas :-(

5. Results of the week