Challenge

Your Challenge: Implement a Motor Tester

Background

One of the biggest things that makes embedded programming interesting is working to control both hardware and software. There are several low-level (closer to the physical hardware components) peripherals on-board the microcontrollers for interfacing with various devices. The low-level libraries you will be working with for this bootcamp are the serial peripheral interface (SPI) and the timers (TIM).

Instructions

Your task is to input a potentiometer value from 0 to 3.3V and convert it to a PWM signal to control a motor. The potentiometer is connected to an external ADC chip which sends data to the MCU over SPI. Motor testers are useful for determining servo motor range, continuous rotation motor speed, prototype testing, and centering servos.

efs bootcamp setup.drawio (3)-20240113-195744.png

 

Documentation is provided for each step in the process in the next bootcamp pages.

  1. Fork this repository so you can edit it (See Setting up the Dev Environment and Git)

  2. Set up development environment

  3. Open the project in the STM32 Cube IDE

  4. Configure Microcontroller (.ioc) file pins based on schematic

  5. Configure SPI peripheral (ADC)

  6. Configure timer for PWM signal

  7. Write code to convert ADC input to motor control signal

  8. Debug all Compiler Errors

  9. Create a git pull request and message in the your fw-onboarding thread in the WARG Discord to have it reviewed

  10. Once approved, come into the bay to test your code if you are on campus!

A preliminary schematic of the circuit board created for this bootcamp: