Self-Balancing Robot
User Guide
30
www.terasic.com
July 12, 2018
◼
◼
E
E
x
x
a
a
m
m
p
p
l
l
e
e
D
D
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
s
s
Figure 1- 23
is for the system architecture of Self-balancing robot using the ESP32. When the
ESP32 receives the string command from the app via the Bluetooth protocol, it will be transferred
to the UART interface and pass to the UART IP of the QSYS within the FPGA. In this way, the
NIOS CPU can easily read the value of the data register in the IP, and then compare it with the
defined instruction to get an effective instruction and control the movement of the robot.
In the Quartus project of the demonstration, a PIO module is reserved in the Qsys system which is
used for communicating the ESP32 module with FPGA I/O. It can be ignored as it not being used in
the demo.
Figure 1- 23 The Block Diagram of the communication between EPS32 and FPGA
The UART IP is a Qsys built-in component, which user guide is available in:
<Quartus
install
path>\<Quartus
version
ex:
16.1
>\ip\altera\university_program\communication\altera_up_avalon_rs232\doc\RS232.pdf.
The settings for the UART IP is as
Figure 1- 24
, Baud Rate set as115200.