Skip to main content

Week 6: Embedded Programming

· 2 min read

Goal:#

Read the data sheet for your microcontroller and program your board to do something

Result:#

.ino File

D11C14A bootloader

I decided to make the simplest thing possible this week so I had time to work on my documentation site and final project. I started by installing edbg and flashing the D11C14A Arduino bootloader onto my board. After doing this, I will be able to use my computer's USB port and the Arduino IDE to program my board. I followed Jake's instructions as well as Manu's Makefile solution when I ran into an edbg error.

I continued following Jake's other instructions on setting up the Arduino IDE to work with a genereic SAMD11C board. Just my luck, something in the toolchain that hosts the arduino core I needed went down right then. Thank you to Quentin for getting it fixed so quickly!

After that, I just wrote the simplest program I could: if the button is pressed, the LED turns on. I referenced the SAM D11 datasheet, Jake's helpful pin-mapping diagram, and my own design file in Eagle to figure out which was the LED pin and which was the button pin.

My code ended up having to be the opposite of what I originally imagined. When the button signal is HIGH, the LED goes LOW, and vice versa. I'm not sure why but maybe I did something weird in my circuit design? I'm going to ask a TA soon about it.

I also made my own programmer this week! I used Neil's USB-D11C-SWD-10 design and followed his video on flashing the binary for the programmer. Now I don't need to come to the dungeon to program new circuits!