About Me Weekly Assignments Final Project Student Agreement

Embedded Programming

Group Project

The primary goal of this week's Group Project was to look at various microcontroller families and compare their performance and development workflows. To do this, we needed to define a few terms first.

Clock Speed is the microprocessor's operating speed. It is expressed by the number of cycles per second.

Bus Width is the number of bits that are able to be sent to the central processing unit at once.

Memory temporarily stores information

My group looked at three seperate microcontrollers, each from different families, and used datasheets and pinout diagrams to compare the qualities above, as well as noted the variance in the number of pins and the logic level voltage, which is the voltage used to send signals, which are represented in binary.

We looked at a Feather M0 lora 900MHz, a RedBoard, and an ADA Fruit Mini Microcontroller. Each had its own unique specs, so I will link to the spreadsheet we made and discuss the most inportant aspects. Both the RedBoard and the ADA Fruit Mini Microcontroller had a logic level voltage of 5 Volts, while the Feather's logic level voltage is 3.7 Volts. This is important, because using the incorrect voltage can destroy eaither the board, the computer, or both. The Feather also has the highest memory, clock speed, and bus width, and is seemingly the most efficient/powerful of the three microcontrollers.

After that, we decided to program the ADA Fruit board. We connected the board to the computer.


Then we went to Tools, Boards, and Board Manager, until we saw the board we were using.


We installed that, then went to Additional Boards Manager and input the URL


From there, we returned to tools and selected the board we were using.


We used a simple program to blink the light on and off again.




Individual Assignment

For my Individual Assignment, I programmed the board I designed and built two weeks ago. I am comfortable programming in Python, but working with Arduino seemed more practical in this situation. Because I'm not very familiar with C or C++ syntax, I started using TinkerCAD's block code to familiarize myself with the language. TinkerCAD has a feature to have blocks and text next to each other, so I was able to study the code esaily as I started working.


My board has a picture of a chicken on it, so I decided I should have the LED on it to blick out the word "chickens" in Morse Code when the button is pressed.


After I obtained a general understanding of the structure and syntax I needed for my code, I went into Arduino's IDE and coded the rest. Morse Code represents letters through a series of dots and dashes, so I needed my the LED to turn on and off for varying amounts of time. To do this, I would need to have a current sent to the pin the LED is attached to to match the timing of the dot-and-dash pattern. To figure out which pin my LED is attached to, I referred back to the KiCAD design I had made of the board.


According to the design, the LED is connected to pin 3.


Based on this table, that would mean that I would need to use 1. Because I was using a button to initiate the Morse Code sequence, I referred to the KiCAD design again to determine the location of the Button. This was on pin 5, meaning it was attached to 3. To avoid any confusion, as well as to keep my code looking clean and easy to read, I set these as variables. Then I designated the LED to being output and the button to input.


Writing an eight letter word in Morse Code is quite a lot of dots and dashes, which was incredibly daunting at first. Luckily, I realized that I could use loops to my advantage in this situation for some of the letters. For example, an "h" in Morse Code is four dots, so I just stuck the code for one dot into a loop four times. Below is the code for an "i", which consists of two dots.


Initially, each dash was set for the light to be on for one second, then turn off for half a second, and each dot to be the light on for half a second and off for half a second. There would be two seconds in between each individual letter. However, I realized that that would take way too long to run, so I redid the timing so that the dashes were 200 milliseconds and the dots were 100 milliseconds. Then the code was done, so it was time to program the board!

The programming process for this board was pretty much the same as for the one in the group project. This time, instead, I chose the megaTinyCore, which worked with the AtTiny1616 I have on my board.


I changed the chip to AtTiny1616 and uploaded the code.


Here is a video of the completed board:

Links

Code For My Board
Group Project Excel