Week 8 March 15th: Embedded Programming

Microprocessor datasheet reading and programming a board with your board

So before anything else, I specifically and redundantly told my colleagues and instructor I was moving this week and would probably not be able to fulfill every objective this week due to just the sheer amount of work I had lying around. Such work includes but is not limited to: moving 5 beds and enough furniture to house a 200m^2 area, retiling a kitchen, removing a radiator unit hanging out the 9th floor apartment using only paracord, moving an air conditioning unit+600L fridge+2 washing machines to a truck because you thought that would be a good workout, removing a wooden piano by dismantling it piece by piece to try to fit through the front door and realizing it still won't fit so you just 'fixed' that with a hammer, and blowing up clogs using explosives and water pressure.

The good news is that I'm finally done so no more future delays regarding houses and moving, not to mention I own private property to make a man cave using container boxes. Bad news is I knew I couldn't finish this week's assignment and was basically rushing through my work with the knowledge of my first delay and if this particular week is when Prof G calls on me randomly, I hopefully wish this is an adequate excuse. Totally made a cool hidden door wall though:

its that colour because its the cheapest

So I read through the datasheet with no idea what I was reading, but we had a class after and I am familiar at least with the terminology and certain basic things such as AREF being connected where, difference between RAM and SRAM, why the minimum pulse length should be to reset buttons, etc. I started milling the circuit board and found after 3 iterations the actual problem of why my boards were coming out janky as 'heck' after replacing the mill bit(I did solve the reason why my colleagues kept having problems on why their mill would drill only small holes and then jump to another hole and not drill any paths, which I found was probably due to the Z axis being maxed out all the way below and adjusting the mill from there to touch the surface, which doesn't allow the drill to extend anymore to drill a path which made it keep jumping) making different files on fabmodules, heat gunning the circuit board to make it flatter, and generally hating myself. It turns out the four clamp bolts were not secured which make the whole milling base vibrate which explained in hindsight why the uneven paths and even though I milled a board with the same file, the failure locations were different. I hate Occam's razor.

I hate you so much machine

So I soldered the board and then I somehow stripped the middle path of the resonator, so I think? I fixed it with connecting wire. Hopefully this shouldn't cause any further issues, but anywho I finished the board.

probably shouldn't have rushed would do again, a perfect 7/9

I first used Ardiono IDE and selected the correct processor and clock speed to successfully booted a bootloader. Now I download the .c code avaiable in FabAcademy to flash that into the Attiny using good old Git Bash. I used avrdude and using the code: "avrdude -c usbtiny -p atmega328p -U flash:w:code.hex:i"

works but why

Btw, so it turns out there was an issue with the component initally lol. We used the processors from the box but apparently they were somehow mixed with slight variations or something(Edu's not sure) so this caused several errors while coding. So once we replaced the atmega on board and booted up the bootloader and loaded (see what I did there)(after the processor's signature was identified) the file from this particularily helpful link: Link again and this time changed the code, and it seemed to have been the issue. As no faults were discovered so I imagine it did or somehow the Gods of Code felt benevolent today and allowed me to endeavor this trial of theirs. I then uploaded the simplest libary code file and pressed the button and it worked. I still hate coding though.

This is the blink code file: Download .c file