It's electronics week again! This week we are remaking the echo hello world board and adding more components to it. I learned how to draw schematics and design PCB layout in Eagle.
Tools used: avrdude, eagle
Useful links: eagle tutorials - schematics, board layout, programming with makefile and c.
Eagle takes a bit of time to get used to, but once you get the hang of it, it's pretty straightforward and the command lines are very nice to use. I found the tutorial from fab academy a good place to start. To make the echo hello world, I downloaded fab.lbr which had all the parts we needed.
We need to add at least a button and a LED (with current limiting resistor; I used 499 ohm). Here's the modified schematic.
After finishing the schematic, it's time to route the board. Click "Switch to board" under "File" in schematic view. You will be directed to the board design, which has all the components clustered in the bottom left corner. Everything that is electronically connected are connected with a yellow line. Once you route the connection, the yellow line will disappear. To make sure traces can be properly milled, turn on the grid (under "View") and set the size to 16 mil (which is about the finest distance-1/64''-the mill can handle) or specify in design rule (the little icon that says DRS) that the minimal distance need to be 16 mil.
Once the board is all routed, I exported the trace as a png with 500 DPI (matching the DPI on the millling machine) by turning on only the top layer. To do so, go to "View" -- "Layer settings".
You can also export the outline in Eagle but Allan showed me a neat trick by using Photoshop to uncrop the traces image to create the outline (and erase all the white traces). This trick is useful especially when your outline is some irregular shape.
I then milled the board like how we did in week 3. Although I exported the image as 500 DPI, which is the same on the mill, my board size was off by a factor of 2. I was told that's just something that happens at times. So I changed DPI on the machine to 1000 and it gave me the correct dimension.
After taking the board out, I realized my outline was off so the leftmost part was cut off. I decided to connect the three pieces with wires instead of remaking the whole board.
Soldering went a lot faster this time! I tried to make the board as compact as possible but it was a bit difficult to solder at times.
The next step is to program the board with the programmer we made in week 3 to test echo hello world's functionality. I followed the programming tutorial from the class page.
The first problem I ran into was my computer does not recognize USBtiny from the programmer, even though it worked two weeks ago... I knew the USB connection was not well soldered and the four lines did not have even thickness (every shortcut you take will come back to haunt you), so I went back to fix the connection. And it worked!
However, that's just the first step. I then had an intialization error when I tried to configure ATting to run at 20 MHz. I haven't figured it out yet. I will update this page soon once I make progress...
Couple weeks after the electronics design week, I came back to the assignment and remade my board. By then, I was much better at soldering and the board actually programmed on the first try! I used Neil's code to test it and it echoes!.