4. Embedded Programming¶
Overviews¶
This week’s goals was to buff up on my knowledge on multiple Micro Controllers by learning about the Seeed Studio XIAO Esp32-C3, the Seeed Studio XIAO RP2040, and the ATtiny412. I used the softwares of Arduino and Micro Python to program each controller except the ATtiny412. I learned how to download and use each program as well
Esp32-C3¶
Overview¶
The Seeed Studio XIAO Esp32-C3 or the C3 is a personally favorite of mine out of the three controllers. This might be because of my hatred for the Rp2040s but thats not important. It is a very reliable chip that can be programed relatively easily, with little trouble shooting or problems. It can connect to Wifi, be powered by Battery, be programmed by Micro Python or Arduino, and is relatively cheap.
Work Flow¶
The Work flows for the C3 and Rp2040 for both the Arduino and Micro Python are extremely similar, however with some significant differences and discrepancies that I will address in the Rp2040 section.
Arduino¶
A. Firstly I need to download the newest Arduino IDE, where I could write the code, on my MacBook. I went to the Arduino website and downloaded it from there.
B. I located my code from a TinkerCircuit tutorial called Arduino button, its simple and written in C++ but I wanted to be sure the code worked and this was more about testing the Boards and the softwares then coding. Depending if you use GPIO pins leave the pins as numbers if you use digital pins put a D in front of the pin number.
C. After successfully downloading and opening Arduino IDE I decided to test my code on Wokwi an electronic testing site. First I had to create the circuit with both an input and output, hence you push a button and a LED turns on. It works by letting the electricity follow the path of least resistance between the two resistors, one of them in 10k ohms whilst the other 330 ohms. So once I push the button it connects the power and allows it to flow through the less powerful resistor to the LED. I am not cutting the power just redirecting it. Then all I need to do is recreate the Circuit in real life following the diagram perfectly.
C. After downloading Arduino I went to boards manager and found the ESP collection which I then used to download all the Seeed Studio ESPs. After that I connected my circuit using a USBc converter to USB to USBc cable. Its all very stupid because I didn’t have a USBc to USBc data cable. On mac be sure to use the bottom of the two ports because that port will power your controller whilst the other top port will not.
D. Finally I selected the correct port that connects to “ESP Family Device” this is the generic message that means you’re connected to an ESP board but the computer does not know which one. And then I selected the Xiao C3 board.
E. Now for the fun part, I copy and pasted my Wokwi code into Arduino IDE and then clicked upload. From here the code is verified and then uploaded to the controller. This may take a while the very first time. And with any luck your LED should blink whenever you press the button.
Use this trouble shooting guide if there are any problems.
Micro Python¶
A. Firstly I needed to download the Python