Embedded Programming

Continuation from Electronics Design

We will explore how to program the echo hello-world board here and continue where we left off in Electronics Design.

Assignments

Before we can begin testing our board, we will need to download some additional boards manager.

  1. Open up Arduino IDE and go to Settings. Under the "Settings" tab, go down to "Additional boards manager URLs:" and key in : http://drazzy.com/package_drazzy.com_index.json
  2. Under "Tools", go to "Board" then "megaTinyCore" and select "ATtiny412/402/212/202".
steps to setting up the board manager

Next, we will check and label our UPDI and echo hello-world board. This is to ensure we do not incorrectly connect the two boards together potentially damaging our board or even our computers.

Labelling UPDI and hello-world board

Now we will burn a new bootloader for the board. All the settings will be done under the "Tools" tab.

  1. Go down to "Programmer:" and select "SerialUPDI - SLOW: 57600 baud".
  2. We will go to clock and select "8 Mhz internal".
  3. Finally, we will select "Burn Bootloader".

Following the image below, we can now program our echo hello-world board LED to blink every other second. This will be our way of testing the board.

testing hello world board programme

I had initially experienced a lot of issues getting my board to work and went through a lot of troubleshooting. This included hours of resoldering, multimeter testing and rereading schematics to ensure everything was correctly connected. However, at last with the help of my lecturer, he found out that the reason was simply that the version of Arduino I was using required me to use "Upload Using Programmer" instead of the standard "Upload".

hello world board not working

After testing that our board works, the assignment calls for us to program our board to do something so we will write a simple programme that uses our button.

simple programme

note: MacOS may ocassionally stop the Macbook from reading the usb serial for security purposes. This would normally result in either the "Port" not showing up or an error code return "UPDI initialisation failed". We would hence need to download a driver that will allow us to bypass the MacOS in-built security features. The driver can be found here.