AT32F421
Series Reference Manual
2022.11.11
Page 28
Rev 2.02
Figure 1-4 Comparison between bit-band region and its alias region: image B
0
bitband alias region
(total 32M bytes)
0x2000_0000
0x2000_0001
0x2000_0002
0x2000_0003
0x2200_001C
1
2
3
4
5
6
7
0x2200_0018
0x2200_0014
0x2200_0010
0x2200_000C
0x2200_0008
0x2200_0004
0x2200_0000
0x200F_FFFC
0x200F_FFFD
0x200F_FFFE
0x200F_FFFF
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0x23FF_FFE0
0x23FF_FFE4
0x23FF_FFE8
0x23FF_FFEC
0x23FF_FFF0
0x23FF_FFF4
0x23FF_FFF8
0x23FF_FFFC
bitband region
(total 1M bytes)
Bit-band region: address region for bit-band operations
Bit-band alias region: access to the alias region has the same effect as read-modify-write operation on
the bit-band region
Each bit in a bit-band region is mapped into a word (LSB) in an alias region. When accessing to the
address in a bit-band alias region, such address is transformed into a bit-band address first. For a read
operation, read one word in the bit-band region, and then move the targeted bit to the right to LSB before
returning LSB. For a write operation, first move the targeted bit to the left to the corresponding bit number,
then perform a read-modify-write operation on bit level.
The address ranges of two memories supporting bit-band operations:
The lowest 1 Mbyte of the SRAM: 0x2000_0000~0x200F_FFFF
The lowest 1 Mbyte of the peripherals: 0x4000_0000~0x400F_FFFF
For a bit in the SRAM bit-band region, if the byte address is A, the bit number is n (0<=n<=7), then the
alias address where the bit is:
AliasAddr = 0x22 (A-0x2000_0000)*32+n*4
For a bit in the peripheral bit-band region, if the byte address is A, the bit number is n (0<=n<=7), then
the alias address where the bit is:
AliasAddr = 0x42 (A-0x4000_0000)*32+n*4
Table 1-1
shows the mapping between bit-band region and alias region in SRAM:
Table 1-1
Bit-band address mapping in SRAM
Bit-band region
Equivalent alias address
0x2000_0000.0
0x2200_0000.0
0x2000_0000.1
0x2200_0004.0
0x2000_0000.2
0x2200_0008.0
…
…
0x2000_0000.31
0x2200_007C.0
0x2000_0004.0
0x2200_0080.0
0x2000_0004.1
0x2200_0084.0