Through these tutorials, you may learn basic electronics through Arduino.
There are "Try it Yourself" and "Assignment" in the tutorials that you should follow.
- Understand Arduino’s hardware
- Start using Visual Studio Code IDE with Platform IO
- Write basic Arduino codes
- Know the meaning and usage of different data types
- Know how to use arithmetic operators, comparison operators and Boolean operators
- Know how to use if…else, for, while statements
- You may skip this if you are familiar with C++
Set up serial communication in Arduino
Set up communication between Arduino and the computer via pySerial
- Digital output
- Digital input
- PWM output
- ADC input
- Control motor’s rotation speed using PWM
- Detect the speed of motor by speed sensor
- Perform a basic feedback control
- Control servo motors
- Read analog signal
- Understand analog signal reading and I2C communication protocol
- Take reading from different sensors
Timer, PWM and Interrupts
- Understand Timer
- Use PWM
- Use External Interrupt
- Use Timer Interrupt
Arduino IDE is easy to use, but its functionalities are limited and low-level manipulations are impossible with Arduino IDE. If you want to dig deeper on MCU and STM32, you may consider the following:
SW4STM32 is a toolchain to program STM32 with STM32Cube HAL and CMSIS, which can be integrate with Eclipse IDE with a Eclipse plug-in.
- STM32Cube HAL is a hardware abstraction layer (HAL) provided by ST Microelectronics, the manufacturer of STM32. It is more easy to use than CMSIS, but ST may discontinue it whenever they like. (Just like what they have done to STM32 Peripheral Library) Controllerstech offers basic tutorials on how to program STM32 with STM32Cube HAL.
- CMSIS is a HAL for the Cortex-M processor (including STM32). It is independent to MCU vendors and is considered as the hardcore way. You'll have to read the reference manuals by ST Microelectronics and manipulate the MCU by altering its registers.
STM32 can be used with Real-time OS (RTOS), which offers functionalities such as event and multi-threading.
We start to use FreeRTOS with STM32CubeIDE in 2020 because they are well integrated.
- As Arduino boards are generally low-performance 8-bit devices, an upgrade path may be the now cheap and powerful ESP8266/ESP32 which have WiFi capabilities.
- For USB emulations, a quick and cheap way is to use Arduino Micro (ATmega32U4-based) that have support in generic Arduino IDE. Advanced use can also be found.