# Overview of Group Assigment 1. Compare the performance and development workflows for other architectures 2. Document your work to the group work page and reflect on your individual page what you learned ## Foreword Our team had referenced <br> <br> 1. [FabAcademy SP 2020 Group assignment](http://fabacademy.org/2020/labs/singapore/group.assignments/assignment06.html) <br> ## Group assignment: 1. Compare the performance and development workflows for other architectures 2. Document your work to the group work page and reflect on your individual page what you learned ## Performance and Development workflow : ### Microbit v1.3 <img src="./microbitv1.3.jpg" height="480"/> Specifications of <a href="https://tech.microbit.org/hardware/1-3-revision/">Microbitv1.3B</a> is as shown <table> <thead> <td>Item</td> <td>Description</td> </thead> <tbody> <tr> <td>Model</td> <td><a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822">Nordic nRF51822-QFAA-R rev 3</a></td> </tr> <tr> <td>Core variant</td> <td><a href="https://www.arm.com/products/processors/cortex-m/cortex-m0.php">Arm Cortex-M0 32 bit processor</a></td> </tr> <tr> <td>Flash ROM</td> <td>256KB</td> </tr> <tr> <td>RAM</td> <td>16KB</td> </tr> <tr> <td>Speed</td> <td>16MHz</td> </tr> <tr> <td>Debug</td> <td>SWD, jlink/OB</td> </tr> </tbody> </table> To use Microbit, we first go to <a href="https://makecode.microbit.org/">makecode.microbit.org</a> to create a project. <img src="./start_microbit.jpg" height="480"/> In the interface, are greeted with options to program the microbit with blocks or wwith javascript. The website is nice in that it provides a simulation of the circuit being run, hence it is easy to see the results of your code. <video height="480" controls> <source src="./microbit_simulation.mp4" type="video/mp4"/> Browser does not support video tag </video> Once we're satisfied with the code, we can download it as a .hex file, and upload it to the microbit by dragging the downloaded file into the microbit folder. Microbit is smart enough to notice that we are uploading a firmware into it and starts to flash it into its memory <video height="480" controls> <source src="./microbit_upload_firmware.mp4" type="video/mp4"/> Browser does not support video tag </video> The video shows the LEDs lighting up in a wave like form, but in reality it only lights up for 1 second, and turns off for 1 second. This is because the LEDs change so fast it is unperceivable to the human eye, but sampled by the camera at some intervals to produce this artifact. <hr /> ### Raspberry Pi 4B <img src="./rpi_4B.jpg" /> Specifications of Raspberry Pi 4B is as shown <table> <thead> <tr> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>SOC Type</td> <td>Broadcom BCM2711</td> </tr> <tr> <td>Core Type</td> <td>Cortex-A72 (ARM v8) 64-bit</td> </tr> <tr> <td>No. Of Cores</td> <td>4</td> </tr> <tr> <td>GPU</td> <td>VideoCore VI</td> </tr> <tr> <td>CPU Clock</td> <td>1.5 GHz</td> </tr> <tr> <td>Debug</td> <td>SWD, jlink/OB</td> </tr> <tr> <td>RAM</td> <td>1 GB , 2 GB, 4 GB, 8GB LPDDR4</td> </tr> </tbody> </table> To use Raspberry Pi, we need to prepare a Linux Distro such as Raspi OS (previously Raspbian) on an SD card. There are many guides online, we can achieve this by flashing the SD card with <a href="https://www.raspberrypi.com/software/">Raspberry Pi Imager</a> <video height="480" controls> <source src="./flash_rpi.mp4" type="video/mp4"/> Browser does not support video tag </video> To make use of the GPIO pins on the Raspberry Pi, we will need to access its operating system and issue commands to its pins. This can be done either via SSH from another computer or via keyboard & mouse along with a display. I chose the latter for convinience. <img src="./connected_rpi_screen.jpg" /> We can view the pinouts of Raspberry Pi via the pinout command. <img src="./rpi_pinout.jpg" /> From the image above, we observe that each "pin" is tied to a GPIO number. This is an important detail later on We can write a python script to access these GPIO pins via RPi.GPIO. The official guide to using the library can be found <a href="https://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage/">here</a>. Raspi OS comes with a convenient IDE called Thonny. We then put a similar logic code into the raspberry pi and show that it can be programmed via Thonny and the script can be executed in the IDE as well. If we leave the cursor in the interpreter located at the bottom of Thonny, we can issue Keyboard Interrrupts to cleanly exit the code and cleanup the pin usages. To use the pins, we need to first set the Library to operate in BOARD mode or SOC mode. BOARD mode allows us to identify which pins to use via "channel numbers", which is a human assigned index on the board that corresponds to a potentially different GPIO pin number. For example, channel 3 refers to GPIO2. After using the pins, it is also the developer's responsibility to clean up the GPIO pins by resetting it to a default state via the cleanup command. <video height="480" controls> <source src="./rpi_blink.mp4" type="video/mp4"/> Browser does not support video tag </video>