Skip to main content
Knowledgebase
Home
Renesas Electronics America - Knowledgebase

How should I describe in C language to access data of a specific address?

Latest Updated:12/01/2011

Question:

How should I describe in C language to access data of a specific address?

Answer:

Declare the address you want to use (with a volatile declaration) and assign a name.
For example, assume that address 10000H consists of 8-bit data and its name is PORT1.
In this case, declare as:

#define PORT1 *((volatile unsigned char *) 0x10000)

You can access this address by:

PORT1 = 0x5;
Suitable Products