beautypg.com

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

Page 76

background image

AN07-00180-3E

- 76 -

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 first.

¥bitpot_red_SampleProgram¥Debug¥SRC

Look at around Line 40 that looks “Figure 4-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, CAN is not to be used and the temperature sensor is to be used.

Figure 4-10 Operation mode settings

As shown in “Figure 4-11 Main function”, there is the main function around Line 131. In it, there are

“microcontroller initialization”, “motor macro initialization”, and “infinite loop”.

Figure 4-11 Main function

/* CAN communication use (1), or unused (0) */

#define CAN_PERMIT

(0)

/* Temperature sensor use (1), or unused (0) */

#define TEMP_SENSOR_USE

(1)

←CAN

←Temperature sensor

void main(void)
{

(omitted);

sysInitialize();


(omitted)

mtInitialize();


(omitted)

/* main loop */

while (1)

{

(omitted)

}

}

←Microcontroller initialization

←Motor macro initialization

←Infinite loop