NIOS控制LCD16207 IP核

发布时间 2023-03-31 17:16:26作者: 浅晓寒

NIOS控制LCD16207 IP核

在Quartus中集成了一个qsys工具,用于搭建sopc系统。qsys中提供了一个LCD16207的ip核,该ip核可以驱动LCD1602,在bsp设置中选择lcd16207为标准输出,即可通过printf()函数将字符输出到LCD上。

查阅官方手册《Embedded Peripherals IP User Guide》,手册中说道:The LCD driver supports a small subset of ANSI and VT100 escape sequences that canbe used to control the cursor position, and clear the display as shown below。LCD驱动程序支持ANSI和VT100转义序列的一小部分,可用于控制光标位置并清除显示,如下所示:

#include <stdio.h>

int main()
{
	printf("\x1B[2;4H");	//光标设置为2行4列
	printf("hello world");	//LCD显示字符
	return 0;
}

如果LCD不显示字符,可能是LCD背光的问题。