分享一個用PROTEUS 做的12864
1. PROTEUS 有完整源代碼
2. 菜單系統很完善,是來自于網絡一位前輩的源碼。
單片機源程序如下:
- //========================================================================
- // 工程名稱:Base_Driver_Demo
- // 組成文件:
- // main.c ----主程序文件
- // LCD_Dis.c/LCD_Driver_User.c/LCD_ASCII.c/GB_Table.c
- // LCD_Dis.h/LCD_Config.inc/LCD_PortConfig.h/LCD_Driver_User.h
- // ----基本驅動程序
- // 硬件連接:
- // LCD DB0~DB7 ---Port0.0~7
- // LCD CS1 ---Port2.0
- // LCD CS2 ---Port2.1
- // LCD Reset ---Port2.2
- // LCD RW ---Port2.3
- // LCD A0(D/I) ---Port2.4
- // LCD EP ---Port2.5
- //
- // LCD 5V供電~~~(建議)
- // 背光供電 3.3V
- //
- // 當前版本: V1.00
- // 日期: 2008-06-23
- //
- // 參考文件:
- // 維護記錄:
- //-------------------------------------------------------------------
- // Version 2008-06-23-V10 Modified By Xinqiang Zhang(小丑)
- //
- //========================================================================
- //========================================================================
- // 文件名: main.c
- // 作 者: xinqiang Zhang(小丑) (email: xinqiang@Mzdesign.com.cn)
- // 日 期: 2008/06/12
- // 描 述: 基本顯示功能演示
- //
- // 參 考: 無
- // 版 本:
- // 2008/06/12 First version Mz Design
- //========================================================================
- #include "LCD_Dis.h"
- #include"LCD_PortConfig.h"
- void Delay(unsigned char Timers)
- {
- unsigned int i=0;
- while(Timers)
- {
- Timers--;
- for(i=0;i<200;i++) ;
- }
- }
- int main(void)
- {
- unsigned char Show_num=0;
-
- P0M1 = 0x00; //P0 設置為準雙向
- P0M0 = 0x00;
- P2M1 = 0x00; //P2 設置為準雙向
- P2M0 = 0x00;
- // LED2 =0;
- // LED1 =0;
- LCD_Init(); //LCD初始化,該函數在LCD_Driver_User.c中定義
-
- SetPaintMode(0,1); //設置繪圖模式及前景色(繪圖模式沒有意義在該驅動中)
- FontSet(0,1); //設置字體類形,字符色為1
- PutChar(0,0,'A');
- Rectangle(10,0,20,16,1);
- FontSet(0,0);
- PutChar(11,0,'A');
-
- FontSet(1,1);
- PutChar(30,6,'A');
- Rectangle(40,0,50,16,1);
- FontSet(1,0);
- PutChar(42,6,'A');
-
- FontSet(1,1);
- PutString(10,18,"Mzdesign 128*64 LCD");
- Rectangle(0,28,127,36,1);
- FontSet(1,0);
- PutString(10,28,"Mzdesign 128*64 LCD");
- Line(0,38,128,38);
- Line(103,0,103,63);
- FontSet(2,1);
- FontMode(0,0);
- PutChar(12,40,0);
- PutChar(30,40,1);
- ……………………
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼
所有資料51hei提供下載:
Proteus仿真A.zip
(1.44 MB, 下載次數: 165)
2018-2-23 08:33 上傳
點擊文件名下載附件
|