AN 773: Drive-On-Chip Design Example for Intel® MAX® 10 Devices

ID 683072
Date 7/26/2023
Public
Document Table of Contents

4.5. Software Application Configuration Files

You can modify the operation of the software application for the Drive-On-Chip Design Example by editing some C source code and header files.
Table 3.  Software Application Configuration Files
File Path Function
demo_cfg.c . Declare motors[] Array
demo_cfg.h . Configuration macros and include file for demo_cfg.c
motor_types.c Platform/motors Declares motor types and encoders
motor_types.h Platform/motors Defines motor and encoder types and include file for motor_types.c
Table 4.  Configuration MacrosThis table lists the configuration macros that you can use to configure the design in demo_cfg.h.
Macro Default State Range Function
FIRST_MULTI_AXIS 0 0 - 1 Index of first motor axis to be controlled.
LAST_MULTI_AXIS 1 0 - 1 Index of last motor axis to be controlled.
DEFAULT_ADC_TYPE ADC_TYPE_SIGMA_DELTA ADC_TYPE_SIGMA_DELTA Use sigma delta ADC samples in control loop.
ADC_TYPE_MAX10 Use MAX10 ADC samples in control loop.

SD_ADC_FILTER

ADC_D_10US ADC_D_10US Sinc3 filter delay 10 us.
ADC_D_50US Sinc3 filter delay 50 us.
DC_LINK_STARTUP_TARGET_VOLTS 32 12 - 48 Target voltage for DC-DC converter.

OPEN_LOOP_INIT

0 0 Start motors in closed loop mode.
1 Start motors in open loop mode.

INTERACTIVE_START

0 0 Normal startup 1:
1 User prompted via Nios II console at each stage of startup

ENCODER_SERVICE

Undefined Undefined Normal operation.

DBG_DEFAULT

DBG_INFO

DBG_NEVER No console output.
DBG_ALWAYS Always output.
DBG_FATAL Debug level set to fatal errors .
DBG_ERROR Debug level set to non-fatal errors and above .
DBG_WARN Debug level set to warnings and above .
DBG_INFO Debug level set to information and above .
DBG_PERF Debug level set to performance data and above .
DBG_DEBUG Debug level set to debug messages and above .
DBG_DEBUG_MORE Debug level set to more debug messages and above .
DBG_ALL Debug level set to all messages.