《防爆磁力启动器原理与维修》 * 技术教程集合 * PLC入门教程 电工基础教程
论坛使用帮助 PLC视频教程下载 升级VIP用户的方法成伟新帖

AT90S8515与点阵液晶模块的C语言编程实例源程序

[复制链接]
查看1194 | 回复0 | 2011-9-7 22:47:14 | 显示全部楼层 |阅读模式
<





/*来源:晓奇工作室*/
/*写汉字液晶子程 液晶屏分为4行*12列汉字,全部使用模拟接口方式。
/* CKW19264A接口程序(模拟方式)
液晶模块供应商:广州市盛宝电子有限公司 Tel:020-87592491 Fax:87541571
Email: tinsharp@public.guangzhou.gd.cn
;************************************************************************
;连线图:
;*LCM----S8515* *LCM----S8515* *LCM-----S8515* *LCM-----S8515* *
;*DB0-----PA0* *DB4-----PA4* *D/I------PC6* *CS1------PC4* *
;*DB1-----PA1* *DB5-----PA5* *R/W------PC7* *CS2------PC5* *
;*DB2-----PA2* *DB6-----PA6* *RST------VCC* *CS3------PD2* *
;*DB3-----PA3* *DB7-----PA7* *E--------PC3* *
;注:S8515的晶振频率为4MHz *
;************************************************************************/
#i nclude
#i nclude
#i nclude /* 自定义字符点阵码文件,存于include目录下 */
file://#i nclude /* 数学运算定义,没有使用 */
#pragma interrupt_handler timer:7 /*TC1溢出中断 */
#define Uchar unsigned char
/***********液晶显示器接口引脚定义***************/
#define LCD_E (1 << 3) // PC3----E
#define LCD_DI (1 << 6) // PC6----D/I
#define LCD_RW (1 << 7) // PC7----R/W
#define LCD_CS1 (1 << 4) // PC4----CS1
#define LCD_CS2 (1 << 5) // PC5----CS2
#define LCD_CS3 (1 << 2) // PD2----CS3
#define lcd_set_e() (PORTC |= LCD_E) // 位置位,输出1
#define lcd_set_di() (PORTC |= LCD_DI)
#define lcd_set_rw() (PORTC |= LCD_RW)
#define lcd_clear_e() (PORTC
热帖推荐
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则