Simple library to interface with Hitachi-compatible character LCDs, for Gowin FPGAs with integrated ARM Cortex M3 Microcontrollers such as the GW1NSR-4C and a specific focus on the Sipeed Tang Nano 4K board. This repository contains an example Gowin MCU Designer project using the library to show off the LCD's features.
If you've got any question reach me out on Twitter @verilog_indeed
-
First, you'll need an FPGA design that sets the CPU in motion, you can use the design provided by Gowin that I slightly modified. FPGA Design, I already included the .fs bitstream file you'll need.
-
Download this repository, open the project in Gowin MCU Designer and run the debug build. The actual LCD library is contained in the LCD_LIBRARY folder.
-
Connect pins 30, 29, 28, 27 of the Nano 4K to the pins D4, D5, D6, D7 of the LCD respectively.
Connect pins 31, 32 of the Nano 4K to the RS pin and the E pin of the LCD respectively.
Connect power to the LCD, a potentiometer to V0 for contrast setting, and tie the RW pin to ground.
-
Connect the board with the USB cable to your computer, open the Programmer provided specifically by Sipeed in "MCU Mode->Firmware Erase, Program" operation.
For the bitstream (first field) select the bitstream from the "gowin_empu" FPGA project (nano_4k_empu/impl/pnr/nano_4k_empu.fs).
For the MCU firmware (second field) select the binary generated by the GMD project (nano_4k_1602_lcd/Debug/nano_4k_1602_lcd.bin)
-
Program the board, now you should see a counter on the LCD!