week 08

input devices.

Note: this work was done starting August 2022.

This week, I wanted to create a board with a microphone on it so that I could use it for my final project. Since I was hoping to connect this board to another one for the sake of my final project, I included a 2x2 header on the board and connected those pins appropriately to the tx and rx pins on my microcontroller. (More about this in Week 10.) I luckily had already made the schematic for this board back in December 2021 with the generous help of Zach, so all I had to do now was route. One quick note about the schematic though. When I opened it up again in August 2020, I was very confused about why I had random capacitors of random values in my schematic. I learned about how a microphone works from Anthony and why the capacitors are needed. However, what I wanted to highlight here is that a datasheet should be consulted to determine what value capacitor or resistor to use! I used to think these values were pulled out of nowhere, but turns out that they are simple calculations given in the GOD sheet, aka the data sheet.

I learned many useful tips from Anthony involving routing.

I also learned how to properly outline the board:

After completeing routing my board, I milled it and soldered the correct parts on. I used the fancy rivet press that Dave (another technical instructor at EDS) hides in his office due to it being easily damaged, so I felt very lucky. Also I "invented" a new technique around now which I use to strip the copper around the USB. I include it here in case it is useful for anyone. So basically a secret is that I am kind of scared of utility knives, so I would really struggle with stripping the copper, especially because I was also really scared of accidentally damaging my traces. So I figured out that you can actually use the solder iron to strip the copper! You just gently heat the copper and if you're lucky it'll just start peeling when you scratch it with the solder iron. If you are unlucky, you might still have to use the utility knife, but it will be way easier.

By this time, I had also made my own programming board (documented in Week 3), so I wanted to use it to bootload the microphone board. I plugged everything in and then ran lsusb. My board was recognized by my computer! I then followed Jake's guide: I already had edbg installed from December 2020, I downloaded the correct binary for the bootloader (I was using a SAMD11C microcontroller) and placed it in the correct place (under the edbg folder on my computer), and then I ran the proper command to burn the bootloader. Unfortunately, I got an error that even Anthony hadn't seen. The error said that "Error: incorrect DAP_INFO_CAPABILITIES size".

After some Googling, I found another fab site that had the same issue. However, there was no resolution presented there, so I still do not know how to fix this issue. It seems to be a Mac specific issue. Therefore, for my board, I just used the Atmel ICE to burn the bootloader using edbg. This time, everything worked properly! Now I could move onto to programming, which was pretty straightforward. Using the Arduino Serial Plotter (second picture) or using an oscilloscope (third image), you can see the wave form change when one makes a louder noise. The microphone was working!

Finally, here are the working files: Schematic PCB Arduino Code