金牌会员
- 积分
- 1087
- 金钱
- 1087
- 注册时间
- 2017-3-10
- 在线时间
- 172 小时
|
8金钱
[mw_shl_code=applescript,true]/***************************************************************************************
* Function name 函数名称: wr_reg
* Description 功能描述: 写入寄存器地址/寄存器值
* Input parameters 输入参数: command 寄存器地址或寄存器值
* Returned value 返回参数: 无
* Used global variables 全局变量: 无
* Calling funcations 调用函数: 无
* Calling declare 调用声明: 无
* --------------------------------------------------------------------------------------
***************************************************************************************/
void wr_reg(U8 command)
{
#ifdef BUS_SWITCH
LcdBus = lcd_bus_convert(command);
#else
LcdBus = command;
#endif
_RD = 1;
A0 = 1;
_CS = 0;
_WR = 0;
_nop_(); // _nop_();_nop_();_nop_(); 空闲一个机器周期
_WR = 1;
_CS = 1;
A0 = 1;
}[/mw_shl_code]
/************************************************************/
/*****************LCD控制口线定义****************************/
sbit BLA = P2^7; //控制BLA,但是BLA高电平,LCD关闭,因此BLK=0V,即blk_bit=1;
sbit _RST =P1^0; //LCD 复位信号,电压稳定前应保持低电平。
sbit A0 = P1^1;
sbit _CS = P4^7;
sbit _RD = P1^2;
sbit _WR = P1^3; //端口设置
#define LcdBus P0
|
最佳答案
查看完整内容[请看2#楼]
A0应该连接的是LCD的RS,我记得当初弄RA8875看到过,主要现在没给我电路图,恼火啊,要自己就去分析,几万行代码。。。。。。。
|