标题: 程序是STM32f103驱动大型点阵屏幕的 [打印本页]

作者: 51h1224    时间: 2018-11-29 16:20
标题: 程序是STM32f103驱动大型点阵屏幕的
实际测试,动态扫描的屏幕能驱动1.5W分辨率,静态屏可以驱动更大的屏幕。只适合做LED点阵驱动。

单片机源程序如下:
  1. /************************************************************
  2. 发布时要在DEBUG.h中屏蔽启用调试,否则不能烧录字库
  3. **********************************************************/
  4. #include "stm32f10x.h"
  5. #include "IO.h"
  6. #include "Uart.h"
  7. #include "Timer.h"
  8. #include "Adc.h"
  9. #include "Spi.h"
  10. #include "Flash.h"
  11. #include "Iwdg.h"  
  12. #include "Datahandle.h"
  13. #include "Display.h"
  14. #include "Move.h"
  15. #include "Font.h"
  16. #include "DEBUG.h"


  17. /*
  18. * 函数名:StartInt()
  19. * 描述  : 初始化函数
  20. * 输入  :无
  21. * 输出  : 无
  22. */

  23. void StartInt()
  24. {
  25.         uint8_t XSPXT[16]="   显示屏系统   ";
  26.         uint8_t ZZJDZJ[16]="  正在加电自检  ";
  27.         ////////////////////////////////////////////////////
  28.         IO_Init();//IO
  29.         USART_Config();//串口1,232接口,DB9-235
  30.         USART_Config2();//串口2,232接口,白色座子
  31.         USART_Config3();//串口3,485接口,DB9-67
  32.         BASIC_TIM_Init();//基本定时器6、7
  33.         ADCx_Init();//ADC
  34.         SPI_FLASH_Init();//Flash,SPI
  35.         USART485RX;//485接收模式
  36.         IWDG_Config(IWDG_Prescaler_256 ,781);//初始看门狗5S
  37.         //////////////////////////////////////////////////
  38.         if((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_13) == 1) && (!DEBUG) )//开机自检画面
  39.         {
  40.                
  41.                 ColorLine1 = ColorLine2 = ColorLine3 = 3;
  42.                 Display_flag = 0;
  43.                 X_Axesbit = 0;
  44.                 Y_Axes = 20;
  45.                 for(GetIndex = 0;GetIndex<16;)
  46.                 {                                                                                  
  47.                         WordCodeCount20(XSPXT[GetIndex],XSPXT[GetIndex+1]);
  48.                 }
  49.                 X_Axesbit = 0;
  50.                 Y_Axes = 40;
  51.                 for(GetIndex = 0;GetIndex<16;)
  52.                 {                                                                                  
  53.                         WordCodeCount20(ZZJDZJ[GetIndex],ZZJDZJ[GetIndex+1]);
  54.                 }
  55.                 Display_flag = 1;
  56.                 StartTime = 400;//4S
  57.                 //////////////////////////////////////////////
  58.                 while(1)//开机自检后退出
  59.                 {
  60.                         IWDG_Feed();
  61.                         if(!StartTime)
  62.                         {
  63.                                 ClearTFI();
  64.                                 return;
  65.                         }
  66.                 }
  67.                
  68.         }
  69. }




  70. /*
  71. * 函数名:main
  72. * 描述  : 主函数
  73. * 输入  :无
  74. * 输出  : 无
  75. */

  76. int main(void)
  77. {       
  78.         StartInt();
  79.         while(1)
  80.         {
  81.                 IWDG_Feed();//看门狗
  82.                 if((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_13) == 0) && (!DEBUG)) //字库
  83.                 {
  84.                         Font_Write();//烧录字库
  85.                 }
  86.                 else
  87.                 {
  88.                         DoDatahandle();//Datahandle();//串口数据处理
  89.                 }
  90.         }          
  91. }
复制代码

所有资料51hei提供下载:
STM32显示屏.rar (353.38 KB, 下载次数: 69)



作者: admin    时间: 2018-12-1 03:43
补全原理图或者详细说明一下电路连接即可获得100+黑币




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1