The method involves defining the variables in C language.
Use the following declaration format.
#pragma section @@DATA EXTDATA1 AT 0F000H
unsigned char indata0; /* Input definition */
unsigned char indata1;
:
unsigned char indata5;
#pragma section @@DATA EXTDATA2 AT 0F010H
unsigned char outdata0; /* Output definition */
unsigned char outdata1;
:
unsigned char outdata5;
#pragma section @@DATA @@DATA
After defining the above,
create a link directive file and then define the memory area from F000 as shown below.
Here, define F000 to F0FF as EXTRAM.
MEMORY EXTRAM : (0F000H,100H)
These processing actions make it possible to read external data by referencing indata0 to indata5.
Similarly, data written to outdata0 to outdata5 is output.