FAQ

FAQ

What is the Bit-banding feature? How to use it?  Issue Date:2015-11-02

Bit-banding is a feature supported by the Cortex®-M4 core. The NuMicro® family M4 series, such as M451 series, NUC442/472 series, and NUC505 series, all support the bit-Banding feature.

The Bit-banding feature allows a bit in a bit-band region mapped to a word in an alias region, as shown below. If there is a need to modify a bit, the user only needs to modify the corresponding word to complete the bit setting. 

With the bit-banding feature, SRAM or peripheral registers can be mapped to the respective alias region. Through the modification of words in the alias region, the user will be able to complete bit setting for SRAM or peripheral registers without complicated setup process, thereby increasing the efficiency of bit setting.

 

Bit-banding address is calculated as follows:

bit_word_addr = bit_band_base + (byte_offset x 32) + (bit_number × 4)

bit_band_base is a starting address of the alias region, byte_offset is a word offset of the specified bit, bit_number is a bit offset of the specified bit, and bit_word_addr is the corresponding address of the alias region.

Take the above figure as an example:

For 0x200F_FFFF[7] in the bit-band region, the corresponding alias region is

bit_word_addr = 0x2200_0000 + (0XF_FFFF x32) + (7 x 4)

       = 0x23FF_FFFC

 

Note1: When setting a peripheral register through the bit-banding, at first, the user needs to enable the corresponding peripheral clock source.

Note2: When setting a peripheral register through the bit-banding, if you want to set the bit to unlock, you need to unlock it first; otherwise, the operation will not succeed.

 

Although the bit-banding feature is not supported by the Cortex®-M0 core, the GPIO in the NuMicro® family M0 series is provided with the register Pin Data Input/Output. The user can set the register to control the state of each GPIO. 

Products: Microcontrollers ,Arm Cortex-M0 MCUs ,M051 Base Series ,M0518 Series ,M0519 Series ,Mini51 Base Series ,Nano100/102 Base Series ,Nano110/112 LCD Series ,Nano120 USB Series ,Nano130 Advanced Series ,NUC029 Series ,NUC100/200 Advanced Series ,NUC120/122/123/220 USB Series ,NUC130/230 CAN Series ,NUC131/NUC1311 CAN Series ,NUC140/240 Connectivity Series ,Arm Cortex-M4 MCUs ,M451 Base Series ,M451M Series ,M452 USB Series ,M453 CAN Series ,NUC442/472 Series ,NUC505 Series
Applications:
Function: Peripherals,ARM,Cortex-M4,I/O,GPIO