But, does the address need to be secured as an area?
Isn't simply setting an address to a DTC register enough?
If necessary, tell me a method for performing the declaration in C programming.
The DTC repeat area needs to be secured as an area by the program. Otherwise, the area may be used for other purposes at build time.
Although there are several methods for securing a fixed RAM area in C programming, CA78KOR provides a relatively simple method using the #pragma sfr directive. As a simple test, create a program file to only declare an area for the DTC.
An example below explains how to secure 10 bytes from the address 0xFFD00 as a DTC repeat area when the CubeSuite+ development environment is employed.
#pragma section @@DATA DD1 AT 0FFD00H
unsigned char DTCDATA;
The required definition is as follows:
In the first line, using a "#pragma section" instruction, a data segment is changed from the standard @@DATA to DD1, and allocates the segment starting from the address 0xFFD00. In the second line, an array DTADATA composed of 10 elements of a character data type (bytes) is defined.
When using DTCDATA defined as described above, declare it as an external variable to access each component of the array.
extern unsigned char DTCDATA;
The above definition in the built program will output to the MAP file as indicated below.
* gap * FEFCAH 00D36H
DD1 FFD00H 0000AH DSEG AT
DD1 DTCAREA FFD00H 0000AH