This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C123GXL launchpad的blinky例程,RCGC2寄存器的使用



SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;

ui32Loop = SYSCTL_RCGC2_R;

其中blinky的程序中由上面两句,SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;是使能PORTF时钟,是对RCGC2寄存器bit5作置1操作。

但是bit5的register type是RO:Software can read this field. Always write the chip reset value.只能写其reset值,而寄存器的Reset值是0.

那为什么在blinky的程序中

#define SYSCTL_RCGC2_GPIOF      0x00000020  // Port F Clock Gating Control

SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;

给PORTF所在的bit5置1了呢?我哪里理解错误了?