標(biāo)題:
程序是STM32f103驅(qū)動(dòng)大型點(diǎn)陣屏幕的
[打印本頁(yè)]
作者:
51h1224
時(shí)間:
2018-11-29 16:20
標(biāo)題:
程序是STM32f103驅(qū)動(dòng)大型點(diǎn)陣屏幕的
實(shí)際測(cè)試,動(dòng)態(tài)掃描的屏幕能驅(qū)動(dòng)1.5W分辨率,靜態(tài)屏可以驅(qū)動(dòng)更大的屏幕。只適合做LED點(diǎn)陣驅(qū)動(dòng)。
單片機(jī)源程序如下:
/************************************************************
發(fā)布時(shí)要在DEBUG.h中屏蔽啟用調(diào)試,否則不能燒錄字庫(kù)
**********************************************************/
#include "stm32f10x.h"
#include "IO.h"
#include "Uart.h"
#include "Timer.h"
#include "Adc.h"
#include "Spi.h"
#include "Flash.h"
#include "Iwdg.h"
#include "Datahandle.h"
#include "Display.h"
#include "Move.h"
#include "Font.h"
#include "DEBUG.h"
/*
* 函數(shù)名:StartInt()
* 描述 : 初始化函數(shù)
* 輸入 :無(wú)
* 輸出 : 無(wú)
*/
void StartInt()
{
uint8_t XSPXT[16]=" 顯示屏系統(tǒng) ";
uint8_t ZZJDZJ[16]=" 正在加電自檢 ";
////////////////////////////////////////////////////
IO_Init();//IO
USART_Config();//串口1,232接口,DB9-235
USART_Config2();//串口2,232接口,白色座子
USART_Config3();//串口3,485接口,DB9-67
BASIC_TIM_Init();//基本定時(shí)器6、7
ADCx_Init();//ADC
SPI_FLASH_Init();//Flash,SPI
USART485RX;//485接收模式
IWDG_Config(IWDG_Prescaler_256 ,781);//初始看門(mén)狗5S
//////////////////////////////////////////////////
if((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_13) == 1) && (!DEBUG) )//開(kāi)機(jī)自檢畫(huà)面
{
ColorLine1 = ColorLine2 = ColorLine3 = 3;
Display_flag = 0;
X_Axesbit = 0;
Y_Axes = 20;
for(GetIndex = 0;GetIndex<16;)
{
WordCodeCount20(XSPXT[GetIndex],XSPXT[GetIndex+1]);
}
X_Axesbit = 0;
Y_Axes = 40;
for(GetIndex = 0;GetIndex<16;)
{
WordCodeCount20(ZZJDZJ[GetIndex],ZZJDZJ[GetIndex+1]);
}
Display_flag = 1;
StartTime = 400;//4S
//////////////////////////////////////////////
while(1)//開(kāi)機(jī)自檢后退出
{
IWDG_Feed();
if(!StartTime)
{
ClearTFI();
return;
}
}
}
}
/*
* 函數(shù)名:main
* 描述 : 主函數(shù)
* 輸入 :無(wú)
* 輸出 : 無(wú)
*/
int main(void)
{
StartInt();
while(1)
{
IWDG_Feed();//看門(mén)狗
if((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_13) == 0) && (!DEBUG)) //字庫(kù)
{
Font_Write();//燒錄字庫(kù)
}
else
{
DoDatahandle();//Datahandle();//串口數(shù)據(jù)處理
}
}
}
復(fù)制代碼
所有資料51hei提供下載:
STM32顯示屏.rar
(353.38 KB, 下載次數(shù): 69)
2018-12-1 03:42 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
作者:
admin
時(shí)間:
2018-12-1 03:43
補(bǔ)全原理圖或者詳細(xì)說(shuō)明一下電路連接即可獲得100+黑幣
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1