HCMC University of Technology
HCMC University of Technology
Report Form
Subject: Microprocessor (Lab)
Mini Project
Class: TT03
Group Members:
1/ Tra Quoc Khang - 1951149
2/ Tran Hoang Lam -
3/ Do Hao Nam - 1911640
INDEX
I/ Introduction:
Topic of mini project: Build a system using NIOS II in kit DE10 to connect a
LCD 16 x 2 and H-bridge to control a motor. This system can do the following
tasks:
- When SW0 is ON, LCD blinks the sentence “Hello Word !!! ” in the middle
of row 1 with frequency Hz. (Using timer)
- When SW1 is ON, NIOS II controls the motor by sending PWM pulses to
the H-bridge. LCD displays the duty cycle and the frequency of PWM rules.
- When SW0 and SW1 is OFF, turn off the system.
Reference:
- Datasheet of LCD 16x2
- An instruction of LCD interference
- L298_H_bridge datasheet
II/ Process:
1. VHDL part:
DE10 Kit:
Choose option as follows:
+) GIPO (default): need for connection with LCD 16x2 and 2 ports for H
bridge L298N.
+) Switch: need switch to the cases like the topic (SWITCH 0 and 1)
Next, we choose directory path for the software project and click OK.
- This is the code NIOS II Elispe of our group. In this part, we will introduce
each function and explain it.
The 1st function:
In this function, we will write the data into the register LCD_BASE in the 1st
function above, and in this case, we write each character in the world “Hello
World!!! ” to the register. After waiting 200ms, we will use command “Clear
Display Screen” in the function “send_cmd(0x001)” and return the function.
The 4th function:
This function is used to configure the LCD display. To figure this we have
four command words are sent to LCD, including:
1) Function set(“send_cmd(0x038)”)
2) Display On/Off control(“send_cmd(0x00E)”)
3) Entry mode set (“send_cmd(0x006)”)
4) Display clear (“send_cmd(0x001)”)
To be more clearly, we will present the chart of these steps below:
The 5th function:
In this function, we use to output the frequency to the screen LCD by using
the function “send_data” in the 1st function. It prints “Freq: 1kHZ” to the LCD
screen and in the function “send_cmd(0x0C0)”, this means that we will display the
“Duty: 50%” into the second line.
The 6th function: