This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it value or address?

We use NXP LPC2468 Microcontroller in our target board.

We use Keil tools to build and debug our embedded C++ application.

#define UART1_BASE_ADDR         0xE0010000
#define U1RBR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))

What is contents of U1RBR ?

Is it address 0xE0010000 ?

or

Is it the value stored at address 0xE0010000.

Thank you!

Parents
  • Then that should REALLY scare you, because you really should understand this.

    It's not a processor register, it's a peripheral register whose content can change from external events unrelated to the flow of program code, each time you read it the content can be different. It's exactly the case for the use of volatile. You might need to review some C language documentation to understand why that's critical.

Reply
  • Then that should REALLY scare you, because you really should understand this.

    It's not a processor register, it's a peripheral register whose content can change from external events unrelated to the flow of program code, each time you read it the content can be different. It's exactly the case for the use of volatile. You might need to review some C language documentation to understand why that's critical.

Children