
Download Python 3.7 from python.org, install it on Windows with pip, set a dedicated project folder, and use Idle to run and save simple scripts for embedded MicroPython.
Learn how to print in Python 3 using print with parentheses, and master indentation with if statements and simple examples like Hello Python and number is greater than ten.
Learn how to declare variables in Python without explicit types, create int, float, and string variables, print them, and concatenate strings using the plus operator; plus comments with #.
Learn to work with Python lists by declaring with square brackets, appending items with append, printing list elements, indexing (zero-based), and iterating with a for loop.
Master arithmetic operators in MicroPython, including addition, multiplication, exponentiation with **, and modulus; explore applying them to numbers and lists, plus string formatting with percent-style specifiers.
Explore working with conditions and loops in MicroPython by using if-else statements, logical operators, and the in operator to check city, temperature, and list membership.
Learn to use loops in Python, printing sequences with for loops and range, and control flow with while loops, break, and continue.
Discover how to implement functions in Python with def, create functions with and without arguments, print statements, return values, and add, including country info with capitals, in embedded MicroPython.
Explore dictionaries in MicroPython by building key-value pairs with curly braces, iterating over items, printing results, and deleting keys to manage post codes and ages.
Explore object-oriented Python by implementing a Point class with x and y attributes, using self to access them, and a reset method to zero the coordinates.
Add two new class methods to move x and y coordinates and to calculate distance from a final point using math, then test by resetting, moving, and measuring distance.
Implement the __init__ method to initialize class instances with default x=5 and y=8, and override with provided values; demonstrate p1 and p2 coordinates.
Learn inheritance in object oriented programming by defining a base class contact and a derived supplier class that inherits its init and shared contact list, then add an order method.
Override the base class __init__ in a derived supplier class, use super().__init__ for name and email, add phone, and observe the all_contacts list and the if __name__ == '__main__' guard.
Learn to set up your board by downloading the DSU from MicroPython, extracting the DSU into a hex file, and flashing it onto the board with the STM cube programmer.
Install and configure Cube Programmer and DFAC, extract installers, then connect the board, flash hex with Q Programmer, manage drivers, and verify memory for embedded micro python testing.
Access the microcontroller from a terminal using a serial program like Tera Term, set baud to 115200, and explore MicroPython commands to prepare for driver development in an IDE.
Access the microcontroller using rshell from the terminal, connect via serial, open main.py, and use the repl to print and test code as a precursor to driver development.
Install the Thonny IDE for MicroPython, configure MicroPython as the interpreter, connect to the STM32 port, and run a simple hello world script to verify the setup.
Download the STM32 microcontroller datasheet and reference manual to learn peripherals and memory map, then obtain the development board user guide to locate push button and LED connections.
Learn to construct and access microcontroller registers, configure peripherals via buses and clocks, and navigate the datasheet and memory layout to locate gpio addresses and enable pins.
Locate microcontroller peripherals using the memory map and bus layout, then compute base addresses and offsets for GPIO and RCC to enable clocks and access registers.
Explore how to locate and enable the GPIO clock via the RCC registers, calculate offsets, and configure pin five using the GPIO mode and output data registers.
Develop a bare-metal gpio driver in micro python that enables clock access, configures pin five as output, uses stm.mem32 to write to registers, and toggles pin with a pseudo delay.
Explore the GPIO module in ARM cortex-m microcontrollers, covering port groupings, general purpose vs alternate functions, key registers: direction and data, and APB and the AHP bus and clock options.
Develop a gpio output driver using direct register access in MicroPython, using predefined STM constants instead of manual addresses. Enable clock, set mode to output, and toggle the pin.
Develop a gpio input driver with direct register access, configuring port c pin 13 as input, reading idr, and driving the led with an active-low push button.
Explore how to configure general purpose input/output pins with MicroPython's pin class, covering mode settings, pull-ups, pull-downs, and open-drain options, and access alternate functions via the AF list.
Explore the MicroPython GPIO class by inspecting ports, pin names and states, reading digital logic values, and controlling a green LED.
Develop a GPIO output driver in MicroPython by blinking an LED on pin 5 with a 1-second delay, using high and low values and the output data register.
Configure a gpio input using the pin class for a push button on PC13 (port C) with an active-low pull-down; read the button value and drive an LED in MicroPython.
Explore stm32 timers that create time bases, measure frequency with input capture, and control delays or outputs via output compare and one pulse mode, using prescaler and auto reload register.
Configure a hardware timer to create a background thread by setting frequency and registering a callback. See timer driven execution at a chosen hertz with main thread coordination in MicroPython.
Configure timer three to generate pwm on pc8 at 1 kilohertz with a 50% duty cycle using micro python, then verify with a logic analyzer.
Generate precise pwm signals with changing duty cycles to fade an led using timer two, channel one at 1 kilohertz, driven by a loop that updates duty cycle in percent.
Configure a timer in output compare mode to toggle a GPIO pin, using pre scalar, period, and auto reload to set frequency and duty cycle.
Configure the timer in input capture mode to latch the counter value on a rising edge. Use a callback to obtain a timestamp for events like ultrasonic sensor echoes.
Implement a watchdog timer driver in micro python using machine watchdog timer with a 5 second timeout, fed regularly to prevent reset, and reset via push-button external interrupt.
Develop the realtime clock driver by configuring the RTC to track date and time, set datetime, and trigger events with an interrupt on a push button, printing timestamps.
Explore how analog quantities from transducers and sensors become digital data through ADCs, with insight into resolution, steps, and how reference voltage and bit depth determine the smallest detectable change.
Develop an ADC driver using direct register access by configuring PA1 as an analog input, enabling clocks, and setting conversion start and sequence length before enabling conversions.
Implement the adc init function by enabling gpio clock, setting pa1 to analog mode, enabling adc1 clock on apb2, and configuring the adc regular sequence.
Implement the ADC driver by configuring the control register for continuous or single conversion, starting conversions via software, and reading the result from the ADC data register after conversion completes.
Test the ADC driver by initializing it, starting conversions, and reading 12-bit values in a loop, printing sensor data and observing 4095 versus near-zero with floating input.
Develop an ADC driver in micro python by creating an ADC object, reading analog values, enabling periodic sampling, and mapping p0/p1 to ADC channels, including temperature, vref, and vbus data.
Develop an adc periodic sampling driver by configuring a timer at ten hertz, initializing a 15-sample data buffer, and reading samples with read_timed to print results.
Read the MCU’s internal ADC channels for temperature, VBAT, and VREF using a mask to enable only internal channels with 12-bit resolution, and monitor the readings.
Whether you are new to Python programming or not you need to take a look at this course as an embedded developer.
Do you want to know how to write clean and efficient embedded drivers for stm32 microcontrollers using the python programming language?
If so, then welcome to Embedded MicroPython from Ground Up™
MicroPython is an efficient implementation of Python3 optimised to run on microcontrollers.
Now, why should you ....
Learn MicroPython as an embedded systems developer?
The simplicity of the python programming language makes micropython very easy to learn.
It is very easy to use, and allows you to develop complex firmware and drivers in python with few lines of code
It has an extensive software library which you can import into your project to build very complex solutions. E.g. network socket programming.
It is extensible with C/C++ and assembly, so you can mix assembly and c with micropython to improve code efficiency or simply implement routines that you are more comfortable implementing in low-level code.
So with that understood, let me tell you…
Exactly What You’re Getting
This course can be divided into 3 major sections.
First Section
The first section provides practical python essential training for embedded developers. This section is for developers who are not familiar with the python programming language and those who want to brush up on their python development skills. This is required because we need to know who to write python code before we can develop our firmware and drivers in python.
Second Section
The second section deals peripheral driver development. Over here we shall develop drivers for all the standard peripherals of our STM32 microconctoller.
We shall develop the following drivers:
General Purpose Input/Output (GPIO)Drivers
Power Management Drivers
General Purpose Timer Drivers
Timer Output Compare Driver
Timer Input Capture Driver
PWM Timer Driver
RealTime Clock (RTC) Drivers
A Watchdog Timer (WDG) Drivers
Analog-to-Digital Converter(ADC) Drivers
Analog-to-Digital Converter (ADC) Time Triggered Drivers
Digital-to-Analog Converter (DAC) Drivers
Universal Asynchronous Receiver/Transmitter (UART) Drivers
Serial Peripheral Interface (SPI) Drivers
Inter -Integrated Circuit (I2C) Drivers
Last Section
In the final section we shall develop firmware for addressing advanced topics such as:
Adding Assembly Language Code to MicroPython
Adding C Language Code to MicroPython
Please take a look at the full course curriculum. I hope to see you in the course.