仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
- #include "config.h"
- int main(void)
- {
- // int i=0,j=0;
- // int count=0;
- Stm32_Clock_Init(9);//系统时钟设置
- delay_init(72); //延时初始化
- //LED_Init(); //初始化与LED连接的硬件接口
- Init_12864(); //初始化带字库12864液晶
-
- // Display_string(0,0," 单片机综合设计"); //显示第1行
- // Display_string(0,1," STM32 TEST "); //显示第2行
- // Display_string(0,2,"字库液晶测试实验"); //显示第3行
- // Display_string(0,3," 2018.03 "); //显示第4行
-
-
- // LCD_P6x8Str(1,0,"This is a test");
- // LCD_DispACat(2,90);
- // LCDClearScreen(LeftScreen);
- // LCDSelectScreen(LeftScreen);
- // LCDSetLine(0);
- // LCDSetColumn(0);
- // for (i=0;i<8;i++)
- // {LCDSetPage(i);
- // for (j=0;j<64;j++)
- // {
- // write_12864data(LongMao[i][j]);
- // }
- // }
- //LCD_P6x8Str(2,0," ");
- LCD_P6x8Str(2,0," User:");
- LCD_P6x8Str(3,0," Pw :");
- //LCD_P6x8Str(4,0," User");
- while(1)
- {
- //LED0=!LED0; //指示灯闪烁
- if (Read_Key() == APP_Success)//按键刷新
- {
- LCD_P6x8Str(7,0,"APP_Success");
- LCD_P6x8Str(8,0," ");
- DisplayKeyValue();
- }
- else
- {
- LCD_P6x8Str(8,0,"APP_Error");
- }
-
- delay_ms(10);
- }
- }
复制代码
需要要用Proteus8.8版本才能打开:
STM32+AMPIRE12864.zip
(189.79 KB, 下载次数: 236)
|