Week 4

Embedded programming

Fab Academy

Learning about embedded programming

To do:
Group assignment: I worked with my colleague Jhasmin Ayala
1. Demonstrate and compare the toolchains and development workflows for available embedded architectures

Individual assignment:
1. Browse through the data sheet of your microcontroller
2. Write a program for a microcontroller, and simulate its operation, to interact (with local input and/or output devices) and communicate (with remote wired or wireless connections). Extra credit: Test it on a development board & Try different languages and/or development environments

WHAT I ALREADY KNOW BEFOREHAND?

I understand that programming serves as the "business logic" for a physical device. Therefore, when defining the "if-then-else" rules, I must be clear about the expected actions from the peripherals I plan to use. I learned to program in Fortran, Basic, and Visual Basic many years ago, so programming logic is not entirely unfamiliar to me. However, I am aware that I need to learn the specific syntax and commands for new platforms and languages. Jorge helped me identify some base code that I can use and modify for my needs. I also plan to use AI tools to help me debug and review my code.

Group assignment:

Check this link

Individual assignment:

1. Browse through the data sheet for your microcontroller
I used AI (ChatGPT) to identify the main technical aspects of the datasheet and present some applications
RP2040 Data



















2. Write a program for a microcontroller, and simulate its operation, to interact (with local input and/or output devices) and communicate (with remote wired or wireless connections).
i) I used the wokwi.com website and selected the Arduino Uno option

ii) Started from scratch

iii) I created a code that uses an SSD1306 OLED display and an Arduino Uno microcontroller to display an image of Snoopy on the screen. Previously, I completed the following steps: The Snoopy image was converted to BMP format, and the I generated the code in hexadecimal using https://javl.github.io/image2cpp/, I added an OLED display and made the necessary connections, I ran the simulations (note that this code uses two libraries that Wokwi automatically detects. If you don't have them installed, you will receive a prompt to install them)



Here's a a video of the results of my experiment, and here are the files.
Extra credit: testing it on a development board

REFLECTIONS

Making my physical creation "come to life" and perform actions is incredibly satisfying, but it is far from easy. I learned that failures could occur for various reasons, making systematic troubleshooting essential. Common challenges include:
• Errors in the code itself, such as logic flaws or syntax mistakes.
• Missing or incompatible libraries.
• Connection issues between a peripheral and the board are due to missing or incorrect drivers.
• A malfunctioning microcontroller.
• Forgetting to reset the microcontroller and upload the updated code before testing.