简体   繁体   中英

STM32F4xx peripherals memory map

I've noticed that according to the datasheet and reference manual in those microcontrollers is 128 bytes for GPIOG (for example).

0x4002 1800 - 0x4002 1BFF GPIOG (From datasheet)

My question is: why 128 bytes (1024 bits)? All GPIOG registers only take 40 bytes. Thanks.

It's almost certainly for efficient internal addressing so that the MCU can determine the port by looking at bits 11-14 of the offset from AHB1PERIPH_BASE .

Bit operations inside an MCU are the most trivial and therefore efficient operation. By comparison, decimal arithmetic requires many sequential logic operations and is much more expensive.

If you're really interested in how this stuff works then I'd recommend getting hold of an FPGA development kit and trying out some simple examples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM