STM32 Microcontroller with Peripheral Development
Embedded System
An Embedded System is a combination of computer hardware and software designed for a specific function. These systems might also function within a larger system. These systems can be programmable or have a fixed functionality. In order to work with embedded systems, it is essential to work with a specific microcontroller to understand its hardware and software design. Let us start working on STM32 and its peripheral development.
Architecture of Microcontroller
Key Points to understand the Architecture of Microcontroller
*Memory Map- The program of the microcontroller is stored in the memory. It shows what is included in each memory region.
*Oscillator- The oscillator circuit generates the clock pulses so that all internal operations are synchronized.
*Input/ Output Ports- Controller communicates with the external world through I/O ports.
*Interrupts- This are the signals that informs microcontroller to stop the current execution and execute the Interrupt Service Routine (ISR).
*Operating Frequency- With a 12Mhz clock frequency, the controller could thus execute 1 million instructions per second.
Memory Map of the MCU (STM32F407X)
The width of the system bus is 32 bits. The processor can produce 2^32 of different address, the range is from 0x0000 0000 to 0xFFFF FFFF, that also means the memory map of this processor actually starts and ends at this range. The manufacture of the microcontroller they put there different peripheral inside this memory range.
The GPIO ports are starting from 0x4002 0000 to 0x4002 23FF, there are nine GPIO ports to communicate through the external world. When the processor produces the 0x4002 0000 on the system bus, it is actually referring to the GPIOA registers.
Bus Interface of the MCU (STM32F407X)
The processor basically gives us 3 bus interfaces and those are I-Bus (Instruction Bus), D-Bus (Data Bus) and S-Bus (System Bus).
const char *pMessage = "STM32 Architecture"
This is a string literal (constant data). This will be stored in ROM (Flash Memory), Here word const is used when we build this code these data will be part of read only section of the final executable. When we load this onto the microcontroller these data will be the part of the flash memory of the microcontroller.
char myData[50]
This is a variable data, that means its content can be changed during runtime of the program. This data is a part of data memory (SRAM).
myData[i]= *(pMessage+i)
So, this is a data copy from FLASH to SRAM. When we compile and load this onto the microcontroller, the instruction of the program will get stored in the FLASH memory of the microcontroller. These constant data also will be stored in the flash memory of the microcontroller.
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1208825570894522"
crossorigin="anonymous"></script>
Comments
Post a Comment