常见问答

Häufig gestellte Fragen

What is the Bit-banding feature? How to use it?  Datum: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. 

Produkte: Mikrocontroller ,Arm Cortex-M0-MCUs ,M051-Base-Serie ,M0518-Serie ,M0519-Serie ,Mini51-Base-Serie ,Nano100/102-Base-Serie ,Nano110/112-LCD-Serie ,Nano120-USB-Serie ,Nano130-Advanced-Serie ,NUC029-Serie ,NUC100/200-Advanced-Serie ,NUC120/122/123/220-USB-Serie ,NUC130/230-CAN-Serie ,NUC131-NUC1311-CAN-Serie ,NUC140/240-Konnektivität-Serie ,Arm Cortex-M4-MCUs ,M451-Base-Serie ,M451M-Serie ,M452-USB-Serie ,M453-CAN-Serie ,NUC442/472-Serie ,NUC505-Serie
Applikationen:
Funktion: Peripherals,ARM,Cortex-M4,I/O,GPIO