Assignments
- Learning objectives for assignments (may be very useful when studying for quizzes).
- Suggested: C style guide.
Expand for Hardware Package Components
Components in 2025 Student Hardware Package
- 1x BeagleY AI
- 1x Zen hat: custom built I/O board with LCD (follow link for schematic and data sheets).
- 1x 1/2 sized breadboard
- ~3x LEDs: such as red, green, yellow
- ~3x Buttons, or these buttons.
- Resistors:
- 25x 10,000 Ohms (10k)
- 25x 470 Ohms (0.47k)
- Jumper wires:
- 20x female-to-male
- 20x male-to-male
- 1x 8-LED NeoPixel stick
- 1x USB-A to USB-C cable
- 1x Mounting plate (or similar), with mounting hardware
- 1x Anti-static bag, large enough to put in assembled BYAI + Zen Hat + mounting plate.
- Plastic box to put everything in.
Expand for Assignment Demo Process
Assignment Demo Process
You will demo your assignments to the TAs for marking. This helps ensure no marks are lost due to problems with the TAs running code on their system, and ensures that your solution (which has been fully tested on your system with your hardware) works well!
- If assignment was done as a pair, it's best to have both people there (but not required).
- Each student get 1 free no-show to a marking appointment; after that a 5% penalty for each subsequent unexcused no-show.
Email the TAs and instructor if you are unable to make a sign-up appointment.
Process
- A few days after each assignment is due, the instructor will share a link for how to sign-up for demo slots.
- Most demos will be in Surrey, but some in Burnaby may be possible.
- If you will need to compile your project on the TA's laptop (don't have one yourself), you will need to indicate that when signing up: At most one student per time-slot (per TA) can need the TA's laptop.
- When you arrive for your demo, check in with the TA who may have a sign-in sheet to ensure students are marked in the correct order.
- TAs will mark students in the order of their time-slots, not first-come-first-serve.
- If a student misses their time slot (and the TA was ready for them), then they will have to wait until the TA has a free moment (after students who have marking appointments).
- If you have your own laptop (or are borrowing a friend's), then have your VM and web-browser up and running, and your BeagleBone booted.
- If you do not have your own laptop capable of running the software, then the TA will have a computer that can be used. Their computer will be setup in the way described in the guides. On their computer, they may want you to do the work of extracting/building/..., or they may do it themselves with you there.
- Either way, should expect to bring your BeagleBone and Zen cape to the marking.
- During the demo you will likely need to do the following while the TA is watching:
- Download your code from CourSys
- Compile without any errors (warnings OK, but you should really resolve those!)
- Run your code on your BBG
- You and the TA will exercise your program, showing how it handles both simple and edge use cases (trying to find bugs!). Likely using tools as required by the assignment such as
valgrind
, a web browser, ornetcat
. The TA will likely play around with your solution, possibly getting your help to do things as needed. - Show the TA your code inside of your IDE (or, perhaps they will load it on their computer). They may ask you to explain or discuss some aspect of your code to ensure that you wrote it with at most a reasonable amount of help from others/online/AI.
- The TA will likely take notes as they go, and give you feedback as well. They may comment on the functionality of your solution, or on things they notice in your code (good and bad).
- The TA will likely look at any other files submitted for the assignment (output captures, etc) while you are building your assignment.
- If there are any misunderstandings about requirements, or how to get things running, you and the TA can discuss the issue.
- There may be a mark penalty if any changes to the code are needed in order to get it working. The TA will assign any deductions based on what they feel is reasonable. If there are any disagreements, you and the TA should work on finishing marking and capturing your solution's behaviour; then you can talk to the instructor to work out any issues.
- During the demo, expect to get feedback on your work and how to improve. Treat this feedback as constructive criticism. It will be given to you respecting you and your abilities, and shared as an educator providing feedback on your work.
- Marking is not expected to be a debate: students are welcome to comment on how to demonstrate the full functionality of their solution; however, it is the TA's decision about what is and is not worth marks, or what triggers a deduction. If a discussion between the student and TA cannot easily be resolved, the student is encouraged to discuss it with the instructor.
Assignment 1 - Reaction Timer
Click to expand...
- Assignment description
- Assignment marking guide
- How-To Guides
- Starter CMake project for assignments
- Case assembly demo video
- Quick-start guide
- Networking guide
- NFS guide
- [Optional] WSL Embedded Linux Guide: Brief steps on getting WSL2 setup for embedded Linux development. Combines steps from the Quick Start, Networking, and NFS guides.
- LED Guide: How to control the LEDs via the terminal and C
- Suggested Step: Build a HAL module to allow your application to turn on and off each of the LEDS.
- How can you reduce duplicate code?
- How can you make it convenient to add another LED?
- Suggested Step: Build a HAL module to allow your application to turn on and off each of the LEDS.
- Guide on using I2C to read the ADC for the Joystick or light sensor.
- Sample C program for the BeagleY-AI: tla2024_demo.c. NOTE: Must swap byte order and right-shift value for it to be usable.
- Data sheets and schematic on Zen hat.
- Due Feb 6th by 11:59pm.
Submit via CourSys - In-class quiz Monday Feb 10th; see learning objectives and in-class notes.
- Marking Demo Sign-up [NEW]
- Monday Feb 10: 9am-2:30; 4:30pm-6:30pm; Signup here
Assignment 2 - Linux Light-Dip Sensor
Click to expand...
- Assignment description
- Provided files including
- [NEW] CMake project for LCD (suggest you start with this code).
- Sample output (terminal and UDP)
- Python program to show data via UDP [Highly recommended; but a little flaky!]
noworky.c
periodTimer.h/.c
- [NEW] Assignment marking guide
- How-To Guides
- In-lecture discussed how to structure the application so it could shutdown with a network message.
- Guide on using I2C to read the ADC for the Joystick or light sensor.
- Sample C program for the BeagleY-AI: tla2024_demo.c. NOTE: Must swap byte order and right-shift value for it to be usable.
- To be posted: Rotary Encoder
Rotary Encoder demo (as shown in class with state machine). - [NEW] PWM Guide: How to drive the LED Emitter Zen hat via Linux
- Debugging Guide: Covers GDB Server, Cross-GDB, Eclipse, and stripping a binary.
- Data sheets and schematic on Zen hat.
- Due Thursday, Feb 27th by 11:59pm. (Note: Quiz 2 on Monday Mar 3rd)
Submit via CourSys- [NEW] Demo Signups
- [NEW] Demo Signups
Assignment 3 - BeatBox
Click to expand...
- Assignment description.
- Guides and Provided Files:
- Zen Cape Audio Guide covering the Zen hat, USB Audio, and PCM audio output via ALSA in C
- Zen Hat audio overlay and TLV320AIC3104 driver.
- ALSA Code Samples:
wave-player.zip
: Sample C application for PCM audio output via ALSA.audio_cmake.zip
: The wave-player app built using CMake instead of a Makefile.audioMixer_template.zip
: Template of an audio mixer code for mixing real-time PCM sounds into one output stream. You can use this code directly in your assignment.
- Drum sounds suitable for creating a drum beat. From Freesound.org, by "menegass", used under Creative Commons license
- Student created guide for using ALSA with Rust (targeting BeagleBone Black, but may be relevant).
- Accelerometer: No guide is provided for using this specific part on the Zen Hat.
- See I2C guide above for general commands and understanding.
- See accelerometer data sheet (IIS2DLPC) for knowing what registers to read/write. It's I2C address 0x19.
- Provided files including:
- Full website [NEW]
periodTimer.h/.c
- [NEW] Assignment marking guide.
- Zen Cape Audio Guide covering the Zen hat, USB Audio, and PCM audio output via ALSA in C
- Due Monday, Mar 17th by 11:59pm.
Assignment 4 - R5 + Linux
- Assignment description.
- [NEW]Assignment marking guide.
- Video showing game and LEDs
(Video shows assignment from previous year; however, the pointing mechanism remains the same)
- How-To Guides and Docs
- R5 Guide covering installing tools to build R5 code on host and run on MCU R5.
- The
manifest/west.yml
file in the guide has spacing requirements. Here is a copy of the west.yml file that you can copy-and-paste formatted text from.
- The
- R5 MCU Sample Code:
blinky.zip
: Blink GPIO7.neopixel.zip
: Drive a NeoPixel LED stick.sharedMem.zip
: Share memory between the Linux processor and the R5. [UPDATED]
- [NEW] Improved SPI Guide
- This improve guide, based on an SPI guide by William Schmidt, runs much faster than the default bit-banged version and it works with the R5 code for the NeoPixel and LED!
- R5 Guide covering installing tools to build R5 code on host and run on MCU R5.
- Due April 3rd by 11:59pm
Submit via CourSys
Project
See the project information page.