2021-11-06 15:01:04 索炜达电子 3512
项目编号:E2171
文件大小:7.5M
源码说明:带中文注释
开发环境:C编译器
简要概述:
本设计是关于单片机控制的交通灯模拟系统的设计。主要内容有交通灯模拟系统设计方案,主要功能,各功能模块的介绍,电路设计,硬件部分设计,软件部分设计,模拟系统的仿真调试,设计方法以及课程设计的心得体会等等。
该设计中用光二极管来模拟信号灯,紧急车的优先通过请求信号由外部中断技术来模拟。要求使STM32中TIM2作为定时器,要求对通行时间进行倒计时,在LED上显示并进行递减,以此来实现十字路口交通灯的指示功能。为了节省元件,复位部分采用加电直接复位。根据交通灯系统所需要实现的功能要求,先画出中断程序部分的流程图和主程序流程图,然后根据流程图写出其子程序。从而通过模拟系统的仿真来实现该设计所要求的功能。
本系统由单片机系统、键盘、LED 显示、交通灯演示系统组成。最后,系统要求实现如下的交通灯的功能:
1)南北方向(主干道)车道和东西方向(支干道)车道两条交叉道路上的车辆交替运行,主、支干道每次通行时间都设为30秒,然后转向时间为25秒,时间可设置修改。
2)在绿灯转为红灯时,要求黄灯先亮5秒钟,才能变换运行车道;
3)黄灯亮时,要求每秒闪亮一次。
4)东西方向、南北方向车道除了有红、黄、绿灯指示外,采用数码管进行显示(采用计时的方法)。
5)一道有特种车辆(实验时用开关 K1 和 K2 控制),交通灯控制系统能立即让有车道放行,无特种车车道禁止通行。
6)在出现紧急情况(实验中用开关K3控制)时可由交警动手实现全路口车辆禁行而行人通行状态。
设计报告:
设计答辩:
目录│文件列表:
└ 交通灯组
│ 交通信号灯控制系统设计.ppt
│ 单片机控制的交通灯控制系统设计.doc
└ 交通灯
├ CMSIS
│ │ core_cm3.c
│ │ core_cm3.h
│ │ stm32f10x.h
│ │ system_stm32f10x.c
│ │ system_stm32f10x.h
│ └ startup
│ │ startup_stm32f10x_cl.s
│ │ startup_stm32f10x_hd.s
│ │ startup_stm32f10x_hd_vl.s
│ │ startup_stm32f10x_ld.s
│ │ startup_stm32f10x_ld_vl.s
│ │ startup_stm32f10x_md.s
│ │ startup_stm32f10x_md_vl.s
│ └ startup_stm32f10x_xl.s
├ FWlib
│ ├ inc
│ │ │ misc.h
│ │ │ stm32f10x_adc.h
│ │ │ stm32f10x_bkp.h
│ │ │ stm32f10x_can.h
│ │ │ stm32f10x_cec.h
│ │ │ stm32f10x_crc.h
│ │ │ stm32f10x_dac.h
│ │ │ stm32f10x_dbgmcu.h
│ │ │ stm32f10x_dma.h
│ │ │ stm32f10x_exti.h
│ │ │ stm32f10x_flash.h
│ │ │ stm32f10x_fsmc.h
│ │ │ stm32f10x_gpio.h
│ │ │ stm32f10x_i2c.h
│ │ │ stm32f10x_iwdg.h
│ │ │ stm32f10x_pwr.h
│ │ │ stm32f10x_rcc.h
│ │ │ stm32f10x_rtc.h
│ │ │ stm32f10x_sdio.h
│ │ │ stm32f10x_spi.h
│ │ │ stm32f10x_tim.h
│ │ │ stm32f10x_usart.h
│ │ └ stm32f10x_wwdg.h
│ └ src
│ │ misc.c
│ │ stm32f10x_adc.c
│ │ stm32f10x_bkp.c
│ │ stm32f10x_can.c
│ │ stm32f10x_cec.c
│ │ stm32f10x_crc.c
│ │ stm32f10x_dac.c
│ │ stm32f10x_dbgmcu.c
│ │ stm32f10x_dma.c
│ │ stm32f10x_exti.c
│ │ stm32f10x_flash.c
│ │ stm32f10x_fsmc.c
│ │ stm32f10x_gpio.c
│ │ stm32f10x_i2c.c
│ │ stm32f10x_iwdg.c
│ │ stm32f10x_pwr.c
│ │ stm32f10x_rcc.c
│ │ stm32f10x_rtc.c
│ │ stm32f10x_sdio.c
│ │ stm32f10x_spi.c
│ │ stm32f10x_tim.c
│ │ stm32f10x_usart.c
│ └ stm32f10x_wwdg.c
├ Listing
│ │ startup_stm32f10x_hd.lst
│ └ STM32_Text.map
├ Output
│ │ core_cm3.crf
│ │ core_cm3.d
│ │ core_cm3.o
│ │ exti.crf
│ │ exti.d
│ │ exti.o
│ │ led.crf
│ │ led.d
│ │ led.o
│ │ main.crf
│ │ main.d
│ │ main.o
│ │ misc.crf
│ │ misc.d
│ │ misc.o
│ │ startup_stm32f10x_hd.d
│ │ startup_stm32f10x_hd.o
│ │ stm32f10x_adc.crf
│ │ stm32f10x_adc.d
│ │ stm32f10x_adc.o
│ │ stm32f10x_bkp.crf
│ │ stm32f10x_bkp.d
│ │ stm32f10x_bkp.o
│ │ stm32f10x_can.crf
│ │ stm32f10x_can.d
│ │ stm32f10x_can.o
│ │ stm32f10x_cec.crf
│ │ stm32f10x_cec.d
│ │ stm32f10x_cec.o
│ │ stm32f10x_crc.crf
│ │ stm32f10x_crc.d
│ │ stm32f10x_crc.o
│ │ stm32f10x_dac.crf
│ │ stm32f10x_dac.d
│ │ stm32f10x_dac.o
│ │ stm32f10x_dbgmcu.crf
│ │ stm32f10x_dbgmcu.d
│ │ stm32f10x_dbgmcu.o
│ │ stm32f10x_dma.crf
│ │ stm32f10x_dma.d
│ │ stm32f10x_dma.o
│ │ stm32f10x_exti.crf
│ │ stm32f10x_exti.d
│ │ stm32f10x_exti.o
│ │ stm32f10x_flash.crf
│ │ stm32f10x_flash.d
│ │ stm32f10x_flash.o
│ │ stm32f10x_fsmc.crf
│ │ stm32f10x_fsmc.d
│ │ stm32f10x_fsmc.o
│ │ stm32f10x_gpio.crf
│ │ stm32f10x_gpio.d
│ │ stm32f10x_gpio.o
│ │ stm32f10x_i2c.crf
│ │ stm32f10x_i2c.d
│ │ stm32f10x_i2c.o
│ │ stm32f10x_it.crf
│ │ stm32f10x_it.d
│ │ stm32f10x_it.o
│ │ stm32f10x_it.__i
│ │ stm32f10x_iwdg.crf
│ │ stm32f10x_iwdg.d
│ │ stm32f10x_iwdg.o
│ │ stm32f10x_pwr.crf
│ │ stm32f10x_pwr.d
│ │ stm32f10x_pwr.o
│ │ stm32f10x_rcc.crf
│ │ stm32f10x_rcc.d
│ │ stm32f10x_rcc.o
│ │ stm32f10x_rtc.crf
│ │ stm32f10x_rtc.d
│ │ stm32f10x_rtc.o
│ │ stm32f10x_sdio.crf
│ │ stm32f10x_sdio.d
│ │ stm32f10x_sdio.o
│ │ stm32f10x_spi.crf
│ │ stm32f10x_spi.d
│ │ stm32f10x_spi.o
│ │ stm32f10x_tim.crf
│ │ stm32f10x_tim.d
│ │ stm32f10x_tim.o
│ │ stm32f10x_usart.crf
│ │ stm32f10x_usart.d
│ │ stm32f10x_usart.o
│ │ stm32f10x_wwdg.crf
│ │ stm32f10x_wwdg.d
│ │ stm32f10x_wwdg.o
│ │ STM32_Text.axf
│ │ STM32_Text.hex
│ │ STM32_Text.htm
│ │ STM32_Text.lnp
│ │ STM32_Text.plg
│ │ STM32_Text.sct
│ │ STM32_Text.tra
│ │ system_stm32f10x.crf
│ │ system_stm32f10x.d
│ │ system_stm32f10x.o
│ │ systick.crf
│ │ systick.d
│ │ systick.o
│ │ tim2.crf
│ │ tim2.d
│ │ tim2.o
│ │ trifficlight.crf
│ │ trifficlight.d
│ └ trifficlight.o
└ USER
│ exti.c
│ exti.h
│ JLink Regs CM3.txt
│ JLinkLog.txt
│ JLinkSettings.ini
│ led.c
│ led.h
│ main.c
│ stm32f10x_conf.h
│ stm32f10x_it.c
│ stm32f10x_it.h
│ STM32_Text.plg
│ STM32_Text.uvopt
│ STM32_Text.uvproj
│ STM32_Text_STM32_Text.dep
│ STM32_Text_Target 1.dep
│ STM32_Text_uvopt.bak
│ STM32_Text_uvproj.bak
│ TIM2.c
│ TIM2.h
│ Trifficlight.c
└ Trifficlight.h