图形液晶显示驱动实验
一.实验目的
本驱动程序展示了如何在small rtos 中编写图形液晶显示器的驱动程序。
二.实验设备及器件
ibm pc 机 一台
dp-51proc 单片机综合仿真实验仪 一台
三.实验步骤
1. a2 区的a0~a2 分别连接到b3 区的a0~a2。
2. 将a2 区的p10 连接到b3 区的rst。
3. 将a3 区的y0 连接到b3 区的/cs。
4. 将a2 区的a15~a10 分别连接到a3 区的相应接线柱,如下:
a15 --- /g2b
a14 --- /g2a
a13 --- g1
a12 --- c
a11 --- b
a10 --- a
5. 在b3 区的j92 插入图形液晶模块(单色,128×64 点)。
6. 将b3 区的j85 短接,a3 区的jp4 短接。
7. 使用tksmonitor51 进行仿真调试。
四.实验参考程序主要部分
#include config.h
void taska(void);
void taskb(void);
void taskc(void);
void taskd(void);
void taske(void);
uint8 random(uint8 seed)
{
uint16 temp;
os_enter_critical();
temp = ((((uint16) rand()) ^ ((uint16) rand()) + tl0) % (uint16)seed);
os_exit_critical();
return temp;
}
void main(void)
{
osinit();
tmod = (tmod & 0xf0) | 0x01;
tl0 = 0x0;
th0 = 0x0;
tr0 = 1;
et0 = 1;
tf0 = 0;
ossemcreate(zl12864_sem, 1);
lcm_dispini();
osdispclr();
//以下的字符串将在液晶上显示出来
osdispstr(0, 0, small rtos the real-time kernel);
osdispstr(4, 1, chenmingji);
osdispstr(5, 3, zl12864 ex1);
ostaskcreate(taska, null, 0);
while(1)
{
pcon = pcon | 0x01; /* cpu 进入休眠状态 */
}
}
void taska(void)
{
uint8 x,y;
oswait(k_tmo, 30);
osdispclr();
ostaskcreate(taskb, null, 1);
ostaskcreate(taskc, null, 2);
ostaskcreate(taskd, null, 3);
ostaskcreate(taske, null, 4);
while (1)
{
x = random(16);
y = random(8);
osdispchar(y, x, '1');
oswait(k_tmo,1);
}
}
void taskb(void)
{
uint8 x,y;
while (1)
{
x = random(16);
y = random(8);
osdispchar(y, x, '2');
oswait(k_tmo,1);
}
}
void taskc(void)
{
uint8 x,y;
while (1)
{
x = random(16);
y = random(8);
osdispchar(y, x, '3');
oswait(k_tmo,1);
}
}
void taskd(void)
{
uint8 x,y;
while (1)
{
x = random(16);
y = random(8);
osdispchar(y, x, '4');
oswait(k_tmo,1);
}
}
void taske(void)
{
uint8 x,y;
while (1)
{
x = random(16);
y = random(8);
osdispchar(y, x, '5');
oswait(k_tmo,1);
}
}
100W快充充电器的导热材料应用案列
WT2003H4-B008单语音芯片实现智能门铃方案
气体检测仪如何校准?
电阻器的类型有哪些
2018年工业机器人行业十大企业盘点
图形液晶显示驱动实验
上海倍加福新一代R2000长距离测量二维激光雷达介绍
广播系统中如何合理使用音频处理器
PLC案例自保持与解除回路
苹果2023年推出折叠机或暂被命名为“iPhone Fold”
灰尘也能增加电磁辐射
一文看懂什么是VR、AR、MR和CR
国家电网计划今年投资27亿元新建充电桩7.8万个
亚马逊将面临反垄断调查 可能比谷歌更加严格
惠普ENVY15游戏本拆解 这款游戏本内部做工如何
和冠军一起,探索极限,南卡全新品牌形象大使世界冠军郭丹
工作站常用的硬盘类型
西门子博途SCL程序状态显示
利用低电平信号提供良好的CMR所需的线性光学隔离特性
云上多活高可用架构,助力企业实现业务无缝切换与持续稳定运行