An open API service indexing awesome lists of open source software.

https://github.com/nielsouvrard/mcu_32

STM32 quick start
https://github.com/nielsouvrard/mcu_32

Last synced: 11 days ago
JSON representation

STM32 quick start

Awesome Lists containing this project

README

        

# STM32 quick start

This is a quick start to discover the STM32 microcontroller family.
It is based on the STM32CubeIDE, a free IDE from STMicroelectronics.

We use a STM32F103C8T6, a 32-bit ARM Cortex-M3 microcontroller.

- STMicroelectronics
- ARM Cortex-M3 32-bit architecture
- Low-power processor
- Speed up to 72MHz
- Low cost
- Flash memory: 64 Kbytes
- SRAM memory: 20 Kbytes
- Wide range of peripherals

Peripherals:
- GPIO
- ADC
- SPI
- I2C
- CAN
- UART
- Timer
- USB
- DMA

The principals types of instructions available in the Cortex-M3:
- Moving data: Taking data from one place in memory and storing it in another.
Example: 'MOV R0, R1' moves the contents of register R1 into register R0.

- Performing arithmetic: Adding, subtracting, multiplying, or dividing numbers.
Example: 'ADD R0, R1, R2' adds the contents of registers R1 and R2 and stores the result in register R0.

- Making decisions: Comparing values to see if one is greater than the other, and then changing the flow of the program based on that comparison.
Example: 'CMP R0, R1' compares the contents of registers R0 and R1.

So, the Cortex-M3 has numerous instructions that can be used to perform a wide variety of tasks.
Most of them aren't used directly by the programmer, but are generated by the compiler when you write code in a high-level language like C.
It's important to understand the basics of the assembly language to understand how the processor works and how to write efficient code.