This week is pretty similar to week 3, but with a few more moving parts! Our goal was to redraw the echo-hello world board, to add at least a button or LED, and to test it and make sure it works.
I started by downloading the application EAGLE, a program from Autodesk, that's used for electronics design. I also downloaded the Fab EAGLE library from Gitlab so that the design in EAGLE would use components with the same dimensions as the componenets we have in the Fab lab.
In order to build my schematic for the board, I looked at the diagram of the echo-world board that NG shared through the course website:
Here's mine in EAGLE. The green lines represent wires/connections between different components. And the red pieces are the components themselves.
The components are:
From here, I added a button/switch, which is on the left side of the schematic. I also added a red LED in the bottom-right of the schematic. I placed a 1kΩ resistor before the LED so that the LED wouldn't draw infinite current. These additional components are:
I went from the schematic in EAGLE to bard view so that I could start spacially placing components on a flat plane. Here's the layout I ended up creating. I had to rotate a few components in order to get minimal crossover between connections.
From here, I routed the traces for the board and was able to squeeze two traces underneath the microcontroller itself.
Lastly, I added some text--"ZUCK" in the upper-left, "echo hello-world" in the bottom-right--to make the board personal.
To get ready for milling, I hid most of the layers of the board, drew a square on top of my board, and then exported the traces for the board along with the outline of the board as pngs.
For some reason though, the export ended up leading to a weird height that was too big. I realized it was because of the grey text labels a few pictures up. Even though I hid the text layer before exporting, the text was still being used to calculate the height for the exported image. So, to fix this, I rotated a couple of those text labels so that they would all fit within the yellow square I drew.
Here are the final png exports of my design with correct dimensions.
When I brought the pngs to the Roland SRM-20 mill though, the dimensions were once again off! But this time, there was an easy fix. For some reason, I believe my mac computer scaled the pngs too large by a factor of 2, so I changed the dpi from 1000 (which is what I used to export in EAGLE) to 2000 on the fab milling mod.
The print went well! Only thing was that the text was probably too small for the milling machine to mill.
No biggie. The functionality of the actual board was perfectly fine. I used a multimeter to check that all the traces carried current.
I picked up all the components for my board and taped them down on double-sided tape.
Spent some time soldering and this is the result:
I connected my board's ISP header to a programmer and its FTDI header to a FTDI cable connecting to a computer. However, despite trying every different configuration of the orientation of wires, my board wasn't being recognized by the computer whenever I ran lsusb in the terminal.
Was there something wrong with the circuit? I took out a multimeter to examine my board. The LED lit up red when I ran current from the top of the resistor to the bottom of the LED.
However, when I ran current from VCC of the microcontroller to the bottom of the LED, the red LED didn't light up... Aha! Wait, what does this mean? I'm not sure exactly, but I thought it might be important, so I asked Rob to help me analyze the situation.
Turns out, it doesn't mean anything at all haha. Because the controller hasn't been programmed yet, there's a good chance no current is being allowed through the pin that leads to the LED anyway. Dang. So what's wrong with my board? Rob took out the multimeter again and tested the connections between pins on the 2x3 ISP header. Turns out there was a short circuit betwen two of the pins. The culprit: some copper traces underneath my microcontroller were touching even though they shouldn't have been. It took us a microscope and 10x magnification to figure this one out! To fix this, I used a heat gun to remove the microcontroller, used a blade to separate the two copper traces, and then I resoldered the attiny44 back in place. This time, when I connected my board to the programmer and the computer, everything worked out!
Here, you can see the board showing up as "Future Technology Devices International" after I ran lsusb.
I compiled the C program into a .hex file using make -f hello.ftdi.44.echo.c.make.
Then I ran make -f hello.ftdi.44.echo.c.make program-usbtiny to send the compiled program to my board
Finally, I set the clock on the board by running make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses.
And then I disconnected the programmer by removing the wires that were attached to my board's ISP header.
To test the board, I downloaded NG's python terminal. I got this new python terminal up running by executing sudo python term.py /dev/ttyUSB0 115200 in the terminal. In this new terminal, I was able to test my board by typing in one letter at a time, which the board received, and echoed back to me successfully! You can see it in action below :)