本人使用的51开发板为 郭天祥C51 TX-1C开发板 ;
本笔记部分根据B站up主:江科大自化协、郭天祥的教学视频 整理得到
规格书链接 https://download.csdn.net/download/qq_45313604/11903693?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164058990116780265448908%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=164058990116780265448908&biz_id=1&utm_medium=distribute.pc_search_result.none-task-download-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-11903693.pc_search_insert_es_download&utm_term=SMC1602&spm=1018.2226.3001.4187.1
P1
接口 D1~D7 和数码管共接口,为了增大功率,选择通过锁存器关闭数码管。
P2
5管脚是接地,默认低电平,所以只有写的功能。
P3
本章只讨论写的情形
LCD_RS 为高电平即为写数据,LCD_RS 为低电平即为写命令
初始状态 LCD_EN 为低电平,也就是上图中的E
P4
上图即为 void LCD_Init(void) 的代码逻辑
P5
//lcd1602.h
#ifndef _LCD1602_H_
#define _LCD1602_H_
#include <REGX52.H>
#include "delay.h"
//用户调用函数:
void LCD_Init(void);
void LCD_ShowChar(unsigned char Line, unsigned char Column, char Char);
void LCD_ShowString(unsigned char Line, unsigned char Column, char* String);
void LCD_ShowNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);
void LCD_ShowSignedNum(unsigned char Line, unsigned char Column, int Number, unsigned char Length);
void LCD_ShowHexNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);
void LCD_ShowBinNum