Fab Academy Preparation
For my final project, I have been preparing to start fab academy. With the fab preparation, I have been working on fusion tutorials, surface mount soldering, building a 3d printer, milling custom boards, and programming 412 chips. All of these activities were advised by Tom Dubick, as we worked on them in our designated time outside of school, and he recommended we work on these things outside of our classes as well.
Surface mount soldering and programming a ATTINY 412 Chip
To start the first week of Fab training off we began by receiving the majority of our tools. After we received our tools, we reviewed how to surface mount solder, a skill I learned how to do over the summer. The method I found myself proficiently using was to place some solder onto the pad, move the component on top of the soldered pad, heat the solder again, and then you can solder the remaining pins you need to solder because it is held in place by the first joint. I did this on a practice board until I felt confident in my ability to solder my surface mount project, a blown up 555 chip. The 555 chip took a while, but after soldering and testing it, it worked!
After we did the practice board, we made the housing for an ATTINY 412 chip. This involved placing the header pins into a breadboard to ensure straightness, then soldering them in. After the header pins were soldered, I used the same method as previously described to solder the surface mount 412 chip.
After the chip was soldered, we tried to program it using an arduino. I referenced the datasheet for a 412 chip from William Zhou’s embedded programming unit in fab academy. I Linked pin 6 on the 412 chip to pin 6 on the arduino, pin one on the 412 to 5 volts on the arduino, and pin 8 on the 412 to ground on the arduino. I followed my workflow of how to use jtag to program a 412 chip, but here I ran into some issues. When doing all of the jtag uploading, all ports, programmers, and boards have to be correct in order for the upload to be correct. It took a while to understand this, and have everything correct, but eventually it worked. I uploaded the blink example from arduino IDE, and then I used a breadboard to wire all the components together. In this instance I needed to change the example’s LED pin to pin 2, as pin 4 on the 412 corresponds to pin 2 on the arduino.
I then modified the code to gradually blink 3 LEDs back and forth, which required little extra programming, simply adding more delays and lines to flash the LED. The wiring of these components was also not difficult, I could connect all 3 LEDs to the same resistor, and just had to ensure they were all linked to valid pins on the 412.
The next project we were tasked with was where the programming portion gave us issues. We were given the task by Tom Dubick to program the 412 so when a button is pressed an LED will light up. There was a schematic given for wiring, which was helpful due to my inexperience with using buttons, however the code we had to come up with on our own and we had to modify the wiring for a 412 chip not an arduino.
I also ran into issues with uploading jtag to the PC I was using to complete this project. When following the steps Mr. Dubick gave us a set of steps that appeared to be crossed out, despite that they were important to the process. I struggled figuring out what was wrong, but eventually when using the crossed out steps I managed to successfully install jtag to the PC i was using. Unfortunately due to my inexperience with coding, I struggled to find what was wrong with the code I used, I had defined all my variables, there were no syntax errors, and I was using if-else statements to ensure only one thing would happen at a time. Upon asking my classmate Dylan Ferro, He showed me that I needed to define the variable within the looped code, so it would continuously update. After I was given that instruction I fixed some small errors and mishaps in the form of only one equals sign or forgetting a semicolon. Then, my project worked and I was able to successfully light the LED when the button was pressed. My code was as follows;
void setup() {
pinMode(2, OUTPUT); //Led outputs
pinMode(1, INPUT); //Button input
}
void loop(){
int Press = digitalRead(1);
if (Press == HIGH) {
digitalWrite(2,HIGH);
} else {
digitalWrite(2, LOW);
}
}
Workflow for uploading with JTAG
Click file-> preferences
Copy this link and paste it into the Additional Board Manager URLs box then click ok http://drazzy.com/package_drazzy.com_index.json
Check your boards by going to tools-> board-> board manager
Search for megatinycore and install that
After the install completes check to make sure your 412 chip is available by clicking the boards menu again, but this time hover over the mega tiny core boards and ensure you see “412” as one of the options
Download the jtap2updi.zip file from enjproj, paste it to your desktop, and open it without extracting it
Make a copy of the jtag2updi_master.zip and paste it to your desktop
Rename the file to jtag2updi.zip
Go to sketch-> include library-> add .zip library and select your copied jtag2updi.zip
Go to file-> examples-> jtag2udpi
Check your com ports, board, and programmer to AVR ISP to ensure you are matching all components you need to use
Upload the blank jtag2udpi example to your arduino, be patient as it may take a while
Open a new document in order to begin coding to program your 412 chip, and change the board to the 412 chip in the boards manager section
Upload code when finished
Milling Boards
This week we milled boards using a desktop milling machine. There were numerous issues I encountered during this step. The first issue was the workflow we were provided with by Tom Dubick was slightly out of order, as you needed to have a bit in the machine in order to probe the material thickness. I made a fatal mistake right away, after I placed the bit into the machine, I tried to probe the thickness of the board. I followed the instructions on the workflow, but missed a crucial step, making sure the board was electronically connected. I forgot to move the tab over the board, so the bit pressed deep into the copper board. I tried to move the spindle then, but only ended up scratching the copper and breaking the bit. I learned just how fragile the bits are after this, and now realize just how careful I have to be in order to keep the bits in working order. I then made another error. After my machine refused to work, I changed to the machine next to me, and did everything on the workflow correct to a certain point. I had accidentally made the trace depth 2 mm deep instead of 0.2 mm deep. When I cut the board this resulted in torn traces, due to the cuts not being clean. I learned here that it is very important to double check everything that you do or else there could be some severe consequences. I then got a premilled board, as I had learned from my mistakes that I made. I soldered the board, and then uploaded the same program used previously to make the LED blink when using a 412 chip. I then struggled to figure out why I couldn’t upload my code, where I then realized that the power and ground terminals on the board were switched from what was conventional.
Milled too deep
Final soldered board
Broken Bit
Working board