Self-Balancing Robot
User Guide
4
www.terasic.com
July 12, 2018
Figure 1- 3 TERASIC_DC_MOTOR_PWM.v symbol and block diagram
Table 1- 2
describes the Register Table of the motor control IP. Base Address 1~0 is the control
register of PWM, Base Address 2 is the control register of motor brake control. User can read these
registers value through Nios.
Table 1- 2 Register Table for TERASIC_DC_MOTOR_PWM.v IP
Reg Address
Bit
Field
Type
Name
Description
Base Addr +
0
31:0
R/W
total_dur
PWM
total
duration
value
Base Addr +
1
31:0
R/W
high_dur
PWM
high
duration
value
Base Addr +
2
31:3
-
Unused
Unused bit
2
R/W
motor_fast_decay
Motor brake control
1 for fast brake
0 for short brake
1
R/W
motor_forward
Motor direction control :
1 for forward
0 for backward