下载此文档

st7565显示汉字程序(St7565 display Chinese character program).doc


文档分类:IT计算机 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21 下载此文档
文档列表 文档介绍
st7565显示汉字程序(St7565 display Chinese character program)
This is a program I downloaded from the , a little change to get, I hope useful for friends
/******** LCD controller st7565 program ************/
#include <>
#include <>
#include <>
#include """
#define uchar unsigned char
#define uint unsigned int
Sbit SDA=P2^1; //lcd-data
Sbit SCK=P2^3; //lcd-clk
Sbit DI=P2^0; //lcd-A0
Sbit CS=P2^2; //lcd-cs
/*======== write a byte order ==============*/
mand (uchar CMD)
{
Uint i;
DI=0;
SCK=0;
CS=0;
For (i=0; i<8; i++)
{
SCK=0;
_nop_ ();
_nop_ ();
SDA=cmd&0x80;
Cmd=cmd<<1;
_nop_ ();
_nop_ ();
SCK=1;
_nop_ ();
_nop_ ();
}
CS=1;
}
/*======== write a byte of data ==============*/
Write_data (uchar DAT)
{
Uint i;
DI=1;
SCK=0;
CS=0;
For (i=0; i<8; i++)
{
SCK=0;
_nop_ ();
_nop_ ();
SDA=dat&0x01;
Dat=dat>>1;
_nop_ ();
_nop_ ();
SCK=1;
_nop_ ();
_nop_ ();
}
CS=1;
}
/////////////////////////////// LCD initialization ////////////////////////////////////////////////
Void init_1815 (void)
{
mand (0xaf); //0xaf open display, 0xae off display
mand (0x40); / / set the display start line for a total of 64 0x40-0x7f
//mand (0xa0); //RAM column address and column drive in the same order 0-131
mand (0xa1); / / RAM or set the column address and column driver inverse 131-00xb0-0xb8 sequence
mand (0xa6); //0xa6 positive display 0xa7 is reverse display
mand (0xa4); //0xa4 normal display, 0xa5 showed full brightness
mand (0xa2); //0xa2LCD bias ratio 1/9 0xa3 is bias voltage ratio 1/7
mand (0xc8); / / line driver for reverse direction
//mand (0xc0); / / or set the line driving direction is positive
mand (0x2F); / / start internal LCD drive power 0x28 boost voltage regulator voltage follower 0x2c step-up open voltage regulator voltage follower 0x2e step-up voltage regulator on voltage follower X2F step-up voltage regulator voltage follower.
mand (0x25); / / internal resistance ratio
mand (0xf8); / / boos

st7565显示汉字程序(St7565 display Chinese character program) 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数21
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rjmy2261
  • 文件大小21 KB
  • 时间2017-11-23