LCD1602模块的显示需要注意几点:
1、显示两行,第一行的起始地址是0x80,第二行的地址是0x80+0x40 = 0xC0。
2、RS,RW,EN接线没有说一定要接到P1,P2,P3上,只要给对应的管脚高低电平即可,但是必须要接线。
3、LCD1602 VSS VEE管脚要连在一起并接地,在实际电路板上,这个地方也是需要注意的。
这里使用仿真软件Proteus同样的,只需要在Proteus工具中设计电路图,编写原代码,编译,仿真即可,无需Keil工具,但是系统需要安装Keil工具,因为编写代码需要用到Keil for 8051编译器。
proteus构建硬件工程,选择8051单片机类型,编译器选择Keil for 8051。这样,工程中会显示电路设计图视图,pcb设计图视图,源代码视图。
源代码中main.c代码:
/* Main.c file generated by New Project wizard
*
* Created: 周一 12月 13 2021
* Processor: 80C52
* Compiler: Keil for 8051
*/
#include <reg52.h>
#include <intrins.h>
#include <stdio.h>
#include <string.h>
#define uchar unsigned char
#define uint unsigned int
sbit RS = P3^5;
sbit EN = P3^4;
sbit RW = P3^6;
uchar code table1[] = {"hello,world!"};
uchar code table2[] = {"0123456789"};
void delay(uint time)