Week 06: Embedded Programming

Tasks:


1. Browsing through Data Sheets

I decided to go simple and create the board I was supposed to make during week 4, then progam it to blink the LED in specific patters. This was after getting all excited hearing Neil say there were microcontrollers with "radios" and thinking about how cool it would be to make a morse code transmitter (I am licensed, so this is very much legal, thank you very much), but neither I nor Anthony knew whether any of the microcontrollers could tune to any of the ham bands. So, instead, I thought of just making a light blink in morse patterns input by the user.

Thus, I looked at the data sheet for the SAMD11C. There was a lot of information there, but after checking with Anthony on this, one of the most important things for me to notice on the datasheets was the pinout page--very important for making boards since not all pins can serve the same functions.

2. Programming the Board

I'm not new to the Arduino since I had to use it in 6.08 last year, but it definitely had been a while since I'd coded in C++ for a microcontroller. I made the mistake with starting out with Neil's code to make my LED blink, and tried to adapt it before realizing that I am still very confused and new to the real low-level stuff and decided to start from scratch. I looked through some old 6.08 code that I had written as well as some online examples to get the hang of it, and then set off to write my code.

Sad to say, but I did not include any fancy PWM stuff or try to make the LED more than just a binary on/off device, but at the very least I did looking at time differences instead of stalling to have more consistent timing.

My code was very buggy at first, and it took a long time and a lot of edits, but I eventually got it to somewhat work. At first it was a lot of minor random errors, like using a comma instead of a semicolon, but then even after getting things syntactically correct, I had to debug a couple minor function flaws (like forgetting to pause between dots and dashes in a single letter).

Overall, the thing is pretty clunky and not actually useful for anything, but at least it does something.