Figure 5-10 operation mode settings, Figure 5-11 main function – FUJITSU CAN-Motor Board MB91F267N User Manual
Page 100

AN07-00180-3E
- 100 -
Now, take a look at the details of the program.
Look into the following folder of the sample program. There are some files stored in it. At first, open
MAIN.C.
¥bitpot_red_SampleProgram¥Debug¥SRC
Look at around Line 40 that looks “Figure 5-10 Operation mode settings” for operation mode selection.
There are #define settings that enable (1) or disable (0) CAN and temperature sensor.
In this program, both CAN and temperature sensor are to be used.
Figure 5-10 Operation mode settings
As shown in “Figure 5-11 Main function”, there is the main function around Line 131. In it, there are
“microcontroller initialization”, “CAN driver initialization”, “motor macro initialization”, and “infinite
loop”.
Figure 5-11 Main function
/* CAN communication use (1), or unused (0) */
#define CAN_PERMIT
(1)
/* Temperature sensor use (1), or unused (0) */
#define TEMP_SENSOR_USE
(1)
←CAN
←Temperature sensor
void main(void)
{
(omitted);
sysInitialize();
if (gCanEnableFlag)
{
/* CAN Use */
canInitialize();
adInitialize();
}
(omitted)
mtInitialize();
(omitted)
/* main loop */
while (1)
{
(omitted)
}
}
←Microcontroller initialization
←CAN driver initialization
←Infinite loop
←Motor macro initialization