Embedded Programming

making samdino
For this week's assignment, I decided to recreate the samdino board done by Fab Academy 2020 student in Leon, Adrian Torres: https://fabacademy.org/2020/labs/leon/students/adrian-torres/samdino.html Since what I intend to work on for my final project will require a mutlifunctional board that is similar to the aurdino uno one. The samdino (with its excellent documentation) was a great starting point. I began by understanding the board schematics. I noticed he had a 9V input, mainly for a stepper motor, from a 9V battery. While I decided to keep it early on, I added a new 5V suppy for a mini USB port that I had from a rechargable battery supply. It was a very challenging addition to the board since it is very meticulous soldering, which unfortunatelly did not work well when I tried to add it.

missing link
missing link
After several attempts as you will see in the below images, I managed to get a nicely cut and finished board with the 1/64" milling bit. It was time to stuff the board. In my first attempt, it was extremly difficult to get the mini usb in. After several trial and error, I managed to damage the board, and therefore the need for jumper wires. Even that did not work, so I reverted to plan B, which is to dismiss the mini USB, and to figure the recharging locally via female-to-male usb connection.
missing link
In addition to the samdino board, I had did a programmer and a serial converter, as well as a 4[small] pin to 4[large]pin converter, a 10[small]pin to 4[small]pin converter and a 10[small]pin to 4[large]pin converter.
missing link
When testing the voltages across the board, I noticed that the regulator was heating up significantly, which was alarming. This also happened with few other colleagues, so I started looking into the data sheets of the 5V RC converter. It turned out that we did not have the same converter and that I was using the wrong pin layout. It was an easy fix, but also happened when I decided to eliminate the need for a 9V power supply. Therefore, I was satisfied with not replacing it.
missing link
Now that the board were ready to be progammed, I installed edbg and the required binary files. This was the process:
EDBG on Windows:
1- Download EDBG (windows build): https://mtm.cba.mit.edu/2021/2021-10_microcontroller-primer/edbg/edbg-windows.zip
2- Unzip the folder
3- Copy the binary file into the same edbg folder https://github.com/qbolsee/ArduinoCore-fab-sam/blob/master/bootloaders/zero/binaries/sam_ba_SAMD11C14A.bin
4- Run ./edbg.exe -b -t samd11 -pv -f sam_ba_Generic_D11C14A_SAMD11C14A.bin
I was struck with several errors:
Error 1:
$ ./edbg.exe -b -t samd11 -pv -f sam_ba_Generic_D11C14A_SAMD11C14A.bin
Debugger: Alex Taradov Generic CMSIS-DAP Adapter 88B075D3 v0.1 (S)
Clock frequency: 16.0 MHz
Error: invalid response during transfer (count = 0/1, status = 7)

Solution: Flip the pin head


Error 2:
$ ./edbg.exe -b -t samd11 -pv -f sam_ba_Generic_D11C14A_SAMD11C14A.bin
Debugger: Alex Taradov Generic CMSIS-DAP Adapter 88B075D3 v0.1 (S)
Clock frequency: 16.0 MHz
Target: SAM D11C14A (Rev B)
open(): No such file or directory

Solution: Make sure the binary file name matches the command line


$ ./edbg.exe -b -t samd11 -pv -f sam_ba_SAMD11C14A.bin
Debugger: Alex Taradov Generic CMSIS-DAP Adapter 88B075D3 v0.1 (S)
Clock frequency: 16.0 MHz
Target: SAM D11C14A (Rev B)
Programming..... done.
Verification...
at address 0x0 expected 0x0a, read 0xfc
Error: verification failed

Solution: Can’t write an already written programmer with openocd

missing link
And finally, after several battles with endless errors, I managed to program the boards. I had to replace the microprocessors into new samd11c14a, since it seemed like they were not responsive, and that was my last resort. It worked! The assumption is that after several attempts to burn binaries onto them, from edbg and openocd, the got damaged.
missing link
PIR Sensor

Download Files: PIR-Arduino
Servo motor
missing link

Download Files: SERVO-Arduino
Sonar Sensor
missing link
missing link
Download Files: SONAR-Arduino
PIEZO Buzzer

Download Files: PIEZO-Arduino
ESP32-CAM
missing link
missing link