摘要
隨著移動設備的流行和發展,嵌入式系統已經成為一個熱點。它并不是最近出現的新技術,只是隨著微電子技術和計算機技術的發展,微控制芯片功能越來越大,而嵌入微控制芯片的設備和系統越來越多,從而使得這種技術越來越引人注目。它對軟硬件的體積大小、成本、功耗和可靠性都提出了嚴格的要求。嵌入式系統的功能越來越強大,實現也越來越復雜,隨之出現的就是可靠性大大降低。最近的一種趨勢是一個功能強大的嵌入式系統通常需要一種操作系統來給予支持,這種操作系統是已經成熟并且穩定的,可以是嵌入式的Linux,WINCE等等。本文所要研究的就是基于ARM嵌入式系統的交通燈系統的設計與實現。本設計采用了ARM32位的Cortex-M3 CPU的內核的STM32作為核心處理器。
關鍵詞:嵌入式 交通燈 STM32f103 ARM
Abstract
With the popularity and development of mobile devices, embedded system has become a hotspot. It is not a new technique appeared recently, only with the development of microelectronics and computer technology, micro chip control functions more and more, more and more equipment and systems and embedded micro control chip, making the technology more attract sb.'s attention. Hardware and software of its size, cost, power consumption and reliability have made stringent requirements. The function of embedded system is more and more powerful, and more and more complicated, the reliability appears is greatly reduced. A recent trend is a powerful embedded systems usually require an operating system to support, the operating system is already mature and stable, can be embedded Linux, WINCE and so on. This paper is to study the design and Realization of the traffic light system based on ARM embedded system. This design uses the ARM32 bit Cortex-M3 CPU kernel STM32 as the core processor.
Keywords: embedded STM32f103 traffic lights ARM
目 錄
一 引言
二 相關內容和原理 1
三 作品設計要求 1
四 作品方案設計 2
4.1 設計思路 2
4.2 總體設計框圖 3
4.3 總體方案設計參數計算 4
五 系統硬件電路設計及分析 4
5.1 STM32f103芯片介紹及選用 4
5.2 單片機電路原理圖及分析 4
5.3 電源電路模塊原理圖及分析 5
5.4 晶振與復位電路模塊原理圖 5
5.5 LED交通燈電路原理圖及分析 6
六 系統軟件設計及其分析 7
6.1 軟件設計流程圖 8
6.2 ARM交通燈控制軟件設計 8
七 系統軟件代碼 9
7.1 軟件設計流程圖………………………………………………… ………………………9
7.2 部分程序代碼……………………………………………………………………………10
八 Keil軟件的運用與調試……………………… ……………………………………………16
九 實物演示照片…………………………………………………………………………………17
十 作品電路的PCB圖……………………………………………………………………… …19
十一 設計心得及體會……………………………………………………………………………20
十二 參考文獻…………………………… …………… ………………………………………21
/* Configure PE.07, PE.11 and PE.15 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_11 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//輸出上拉
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOE, &GPIO_InitStructure);
LED1(OFF);LED2(OFF);LED3(OFF);LED4(OFF);LED5(OFF);LED6(OFF);LED7(OFF);LED8(OFF);LED9(OFF);LED10(OFF);LED11(OFF);LED12(OFF);
內聯函數定義LED函數部分:
#ifndef _LED_H
#define _LED_H
#include"stm32f10x.h"
#define ON 0
#define OFF 1
/***************內聯函數定義LED函數****************/
#define LED1(a) if (a)
GPIO_SetBits(GPIOB,GPIO_Pin_8);
else
GPIO_ResetBits(GPIOB,GPIO_Pin_8)
#define LED4(a) if (a)
GPIO_SetBits(GPIOA,GPIO_Pin_12);
else
GPIO_ResetBits(GPIOA,GPIO_Pin_12)
#define LED7(a) if (a)
GPIO_SetBits(GPIOD,GPIO_Pin_10);
else
GPIO_ResetBits(GPIOD,GPIO_Pin_10)
#define LED10(a) if (a)
GPIO_SetBits(GPIOE,GPIO_Pin_15);
else
GPIO_ResetBits(GPIOE,GPIO_Pin_15)
#define LED2(a) if (a)
GPIO_SetBits(GPIOB,GPIO_Pin_6);
else
GPIO_ResetBits(GPIOB,GPIO_Pin_6)
#define LED5(a) if (a)
GPIO_SetBits(GPIOA,GPIO_Pin_10);
else
GPIO_ResetBits(GPIOA,GPIO_Pin_10)
#define LED8(a) if (a)
GPIO_SetBits(GPIOD,GPIO_Pin_12);
else
GPIO_ResetBits(GPIOD,GPIO_Pin_12)
#define LED11(a) if (a)
GPIO_SetBits(GPIOE,GPIO_Pin_11);
else
GPIO_ResetBits(GPIOE,GPIO_Pin_11)
#define LED3(a) if (a)
GPIO_SetBits(GPIOB,GPIO_Pin_9);
else
GPIO_ResetBits(GPIOB,GPIO_Pin_9)
#define LED6(a) if (a)
GPIO_SetBits(GPIOA,GPIO_Pin_8);
else
GPIO_ResetBits(GPIOA,GPIO_Pin_8)
#define LED9(a) if (a)
GPIO_SetBits(GPIOD,GPIO_Pin_15);
else
GPIO_ResetBits(GPIOD,GPIO_Pin_15)
#define LED12(a) if (a)
GPIO_SetBits(GPIOE,GPIO_Pin_7);
else
GPIO_ResetBits(GPIOE,GPIO_Pin_7)
void LED_GPIO_Configuration(void);
#endif
這是我近期單片機的課設,查閱大約資料自己做的
燕山大學
嵌入式系統課程設計報告
十字路口交通燈控制系統
學 院:里仁學院
專業班級:過控2班
姓 名:孟*坤
學 號:14*1152
時 間:2017年6月
指導教師:
摘要
隨著移動設備的流行和發展,嵌入式系統已經成為一個熱點。它并不是最近出現的新技術,只是隨著微電子技術和計算機技術的發展,微控制芯片功能越來越大,而嵌入微控制芯片的設備和系統越來越多,從而使得這種技術越來越引人注目。它對軟硬件的體積大小、成本、功耗和可靠性都提出了嚴格的要求。嵌入式系統的功能越來越強大,實現也越來越復雜,隨之出現的就是可靠性大大降低。最近的一種趨勢是一個功能強大的嵌入式系統通常需要一種操作系統來給予支持,這種操作系統是已經成熟并且穩定的,可以是嵌入式的Linux,WINCE等等。本文所要研究的就是基于ARM嵌入式系統的交通燈系統的設計與實現。本設計采用了ARM32位的Cortex-M3 CPU的內核的STM32作為核心處理器。
關鍵詞:嵌入式 交通燈 STM32f103 ARM
Abstract
With the popularity and development of mobile devices, embedded system has become a hotspot. It is not a new technique appeared recently, only with the development of microelectronics and computer technology, micro chip control functions more and more, more and more equipment and systems and embedded micro control chip, making the technology more attract sb.'s attention. Hardware and software of its size, cost, power consumption and reliability have made stringent requirements. The function of embedded system is more and more powerful, and more and more complicated, the reliability appears is greatly reduced. A recent trend is a powerful embedded systems usually require an operating system to support, the operating system is already mature and stable, can be embedded Linux, WINCE and so on. This paper is to study the design and Realization of the traffic light system based on ARM embedded system. This design uses the ARM32 bit Cortex-M3 CPU kernel STM32 as the core processor.
Keywords: embedded STM32f103 traffic lights ARM
目 錄
一 引言
二 相關內容和原理 1
三 作品設計要求 1
四 作品方案設計 2
4.1 設計思路 2
4.2 總體設計框圖 3
4.3 總體方案設計參數計算 4
五 系統硬件電路設計及分析 4
5.1 STM32f103芯片介紹及選用 4
5.2 單片機電路原理圖及分析 4
5.3 電源電路模塊原理圖及分析 5
5.4 晶振與復位電路模塊原理圖 5
5.5 LED交通燈電路原理圖及分析 6
六 系統軟件設計及其分析 7
6.1 軟件設計流程圖 8
6.2 ARM交通燈控制軟件設計 8
七 系統軟件代碼 9
7.1 軟件設計流程圖………………………………………………… ………………………9
7.2 部分程序代碼……………………………………………………………………………10
八 Keil軟件的運用與調試……………………… ……………………………………………16
九 實物演示照片…………………………………………………………………………………17
十 作品電路的PCB圖……………………………………………………………………… …19
十一 設計心得及體會……………………………………………………………………………20
十二 參考文獻…………………………… …………… ………………………………………21