I followed this step by step tutorial to build a "Brian-based" FabTinyISP. The main steps are:
This week is about electronic production: how to build PCBs, how to put components on it...and how to test your work
This week is about famous students projects from previous years. A great source of ideas and also motivation, especialy this week since we are all struggleling with our ISPs. My learnings (for my capstone project) after having seen the video are the followings:
(from Wikipedia) In-system programming (ISP), also called in-circuit serial programming (ICSP), is the ability of some programmable logic devices, microcontrollers, and other embedded devices to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system. To program thee chip, you need some piece of HW.. named an ISP programmer. Here is an example of an ISP programmer:
(from this site) The FabISP is an in-system programmer for AVR microcontrollers, designed for production within a FabLab. That is, it allows you to program the microcontrollers on other boards you make, using nothing but a USB cable/port and 6-pin IDC to 6-pin IDC cable. It's based on the USBtiny and V-USB firmwares, which allow the ATtiny44 to perform USB communication in software.
(from this site) There are multiple models of Fab ISPs. The one I decided to produce is the "Brian" version. Her e is how it looks like:
And here is how it looks like once everything is in place, I'm proud of it !!
The traces, outcut, .. obtained from your CAD SW are typicaly PNG files (images). You need to process them to create G-code (i.e machine specific instructions) that will be executed by the mill to engrave the traces, dig the holes or cut the external limits of your PCB. There are many ways to achieve this but I choose Fab Lab Mods. Here is a typical workflow:
I wrote down some detailed documentation on how to use the mini-mill, with all the steps required to produce someting like this:
The main steps are:
A faced one minor issue. The cut was not deep enough and I was unable to detach the PCB. Instead of going back to the MODS, I just updated the RML file and set the Z parameter to -200 (i.e 2 mm deep)
Another way to produce PCBs is described here. I did not try it but it looks it requires a lot of chemicals (with all the consequences for your health and the environment. Now I understand why the CNC way is better.
I really missed time to try this. I will come back later and give it a try for sure.
Here are the steps:
To start, let's summarize the 3 methods we could use to solder our components
Check this video for a detailed explanation of the 3 methods. As explained in the video, the board designer has to take into account what process will be used in the manufacture. For a double side PCB and a reflow process for example, you should put the heavier components on one side
I tried manual soldering. It is not easy but you learn fast (as fast as you burn your fingers ..).
Use flux ! and check some tutorials before, like this one. I followed Brian's tutorial, starting with the MCU, then components around and finaly the 6 pins header. Once completed, I read some comment arguing that the 6 pin header should be placed first because it is hard to solder at the end. Those are good comments..
Reflow looks not so complex but the temperature has to be precisely controlled to get a clean result without toasting the components. I found a DIY source here to build a reflow oven and I'm in the process of building it. I will link pictures when it will be completed.
Wave is totaly out of reach , this required big and expensive equipment. I visited a manufacture in China 5 years ago and I saw one of those machines. It is amazing how quick the PCB goes over the metal wave and literaly sucks just enough material to fix the componenents at the right place.
Here is my check list (to be processed step by step - stop when not ok and fix the problem before going ahead
But we are designing a PCB programmer, isn't it ?? Yes... but yo know the chicken and egg story... and we need to start somewhere. So.. I bought a chicken... oups.. an USB ASP
The connector on the left matches the PCB 6 pins header. The USB connector on the right goes to the computer.
Here are the steps:
Build the firmware (i.e the binaries that will resides on the MCU and runs there.. forever. To do this, we need first to change the makefile to set the right ISP type (the one I own is a usbASP
We need to set the fuses as well, still in the makefile. Wow... what are you talking about, you totaly con-fuse-d me ! What are "lock/fuse bits" ?
Everyone (well, not me..) knows that AVR MCUs have, in general, three memory areas: FLASH, which is dedicated to program code, SRAM for run-time variables and EEPROM, which can be used by user code to store data that have to be preserved when MCU is turned off. Now, the lock/fuses form a fourth memory area available for programming. This holds a few bytes that contain those bits. For example, ATmega48 has four of them – one byte for lock bits and three bytes for fuses: low, high and extended. What are those bits for? All MCU programmers are familiar with the fact that configuration of peripheral modules is done by setting or clearing some bits in appropriate registers. So the bytes with lock bits and fuses can be thought of as a sort of peripheral configuration registers, determining some very general system settings, like memory access, clock source and divider, start-up options, programming options and so on.
Once the makefile is updated, just type make to build the binaries
Flash the MCU, i.e connect your commercial ISP to your computer (USB) on one side and to the targeted MCU (i.e the 6 pin header of your board) on the other side and then type make flash
Just in case something could go wrong, here is my check list (to be processed step by step - stop when not ok and fix the problem before going ahead
Blow the fuses, still with your commercial ISP connected to your computer (USB) on one side and to the targeted MCU (i.e the 6 pin header of your board) on the other side. Type make fuses
To test your piece of art, unplug the commercial ISP (both sides) and connect your PCB to your computer (we have been told to use a USB extension to preserve the PC USB plugs. Under Linux, if you type dmseg> and lsusb you should see something like this
But the problem is I didn't... Here is what I got
Then I spent more than 1 week trying to figure out what was wrong. I heard some other students had the same issue.. but with a different design (not the one from Brian, not even with a ATtiny85). For the benefit of future students, here are my research assumptions and the outcomes:
Assumption #1 : I did something wrong ! I checked again all components (value , marking). I measured the VCC, I checked whether there could be any short. I tested all lines using an ohmmeter. Nada ..
Assumption #2 : There is an issue with the design (when using a ATTiny85)! I found at least another student who made it. Shame on me !
Assumption #3 : There is an issue with the code ! I checked the changes (basicaly the MCU model and the fuses). I tried some alternate solutions to calibrate the oscillator. I checed all dependencies and I confirmed eveything was identical, at least to what has been demonstrated last year
Assumption #4 : There is an issue with the components ! My classmates have similar issues but with different components. There is a very small chance that we all faced the same defective components. But, anyway, I build a complete new experiment on a breadboard with throuh hole components. I managed to find all of them BUT the ATTiny85. I mounted the SMD one on a socket to make it fit the breadboard.
After many attempts, one of my set of 3 ATtiny85 was bricked and I was not able to flash it anymore, not even to detect it. I found a way to recover it. The design is the following. The wires on the left are connected to a 12v DC supply and the entire process is explained here
Assumption #5 : the design is supposed to be a 1.0 USB device. But why is it detected as a "full speed USB" (see the logs) ? It ended up as dead end but at least I know from now how it works . The detection relies on those two resistors between D- and VBUS. The original USB 1.0 specification, which was introduced in January 1996, defined data transfer rates of 1.5 Mbit/s Low Speed and 12 Mbit/s Full Speed.
Assumption #? : I don't know... I asked a buddy for advices ...
Wow! I definitely need someone more knowledgeable ... I asked my instructor to have a look on it and we also asked the Fab Academy community for advices. See this forum
We finaly managed to make it work. The problem was a component.
This is the one you should order And here is te final result (this time I used ATTINY45V but the problem was identical with ATTINY85)Two steps here: one on the software side, still with your commercial ISP connected to your computer (USB) on one side and to the targeted MCU (i.e the 6 pin header of your board) on the other side. Type make rstdisbl and the other one on the HW side: you have to cut the trace on the top right side, where there is a spot of solder (or a 0 ohm resistor)
From now, you should be able to use your ISP to flash new ISPs... Stay tuned...
I had in mind to produce a first draft but I totaly missed time this week and I don't have (yet) the knowledge for the circuit design. Stay tuned...