找回密码
 注册

QQ登录

只需一步,快速开始

搜索

Proteus仿真STM32F407ZGT6单线控制lcd2004液晶屏

[复制链接]
路漫漫 发表于 2020-5-23 01:25:07 | 显示全部楼层 |阅读模式
一,打开文件(可以随文下载放置在文档中打开)。(如下图1所示) 105144l3ab9kdbdcdsd923.png 图1二,调整原理图大小,适合可视,另存工程文件。(如下图2,3,4所示) 105145qz5mw8zzom5fewzz.png 图2 105145pq0qosy57u0cyuuy.png 图3 105145z1nlrbmblmzb7mr4.png 图4三,点击Source Code标签。(如下图5所示) 105146gz3y35v3szqq3lcp.png 图5四,编辑main.c 代码如Proteus8.9 VSM Studio GCC编译器仿真STM32F407ZGT6系列015_lcd2004一线屏(如下图6所示) 105147nqi1akxcuv5vwszz.png 图6五,Main.c 代码:
  1. /* Main.c file generated by New Project wizard
  2. * Author:   Ziegler Yin
  3. * Created:   周四 一月 16 2020
  4. * Processor: STM32F407ZGT6ZGT6
  5. * Compiler:  GCC for ARM
  6. */

  7. #include "mfuncs.h"
  8. #include "delay.h"
  9. #include "usart.h"
  10. #include "comds.h"

  11. u8 l;

  12. int main(void)
  13. {
  14.         delay_init(84);  //初始化延时函数
  15.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
  16.         uart_init(9600);//初始化串口波特率为115200
  17.       
  18.                
  19.    while(1) //实现比较值从0-300递增,到300后从300-0递减,循环
  20.         {
  21.                
  22.                 init();
  23.                 wrt_lin('0');
  24.                 uprint("Kaillen WorkWork
  25. ");
  26.                 wrt_lin('1');
  27.                 uprint("   Wellcom YOU!
  28. ");
  29.                  for(l=0; l<255; l++) delay_ms(15);
  30.                 wrt_lin('2');
  31.                 uprint(" Code Made
  32. ");
  33.                 wrt_lin('3');
  34.                 uprint("  ---Ziegler Yin
  35. ");
  36.                  for(l=0; l<100; l++) delay_ms(15);
  37.         }
  38. }

  39. stm32f4xx_conf.h:

  40. /**
  41.   ******************************************************************************
  42.   * @file    Project/STM32F4xx_StdPeriph_Templates/stm32f4xx_conf.h  
  43.   * @author  MCD Application Team
  44.   * @version V1.8.0
  45.   * @date    04-November-2016
  46.   * @brief   Library configuration file.
  47.   ******************************************************************************
  48.   * @attention
  49.   *
  50.   * <h2><center>&#169; COPYRIGHT 2016 STMicroelectronics</center></h2>
  51.   *
  52.   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  53.   * You may not use this file except in compliance with the License.
  54.   * You may obtain a copy of the License at:
  55.   *
  56.   *        http://www.st.com/software_license_agreement_liberty_v2
  57.   *
  58.   * Unless required by applicable law or agreed to in writing, software
  59.   * distributed under the License is distributed on an "AS IS" BASIS,
  60.   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  61.   * See the License for the specific language governing permissions and
  62.   * limitations under the License.
  63.   *
  64.   ******************************************************************************
  65.   */

  66. /* Define to prevent recursive inclusion -------------------------------------*/
  67. #ifndef __STM32F4xx_CONF_H
  68. #define __STM32F4xx_CONF_H

  69. /* Includes ------------------------------------------------------------------*/
  70. /* Uncomment the line below to enable peripheral header file inclusion */

  71. //#include "stm32f4xx_adc.h"
  72. //#include "stm32f4xx_crc.h"
  73. #include "stm32f4xx_dbgmcu.h"
  74. //#include "stm32f4xx_dma.h"
  75. #include "stm32f4xx_exti.h"
  76. //#include "stm32f4xx_flash.h"
  77. #include "stm32f4xx_gpio.h"
  78. //#include "stm32f4xx_i2c.h"
  79. //#include "stm32f4xx_iwdg.h"
  80. #include "stm32f4xx_pwr.h"
  81. #include "stm32f4xx_rcc.h"
  82. //#include "stm32f4xx_rtc.h"
  83. //#include "stm32f4xx_sdio.h"
  84. //#include "stm32f4xx_spi.h"
  85. #include "stm32f4xx_syscfg.h"
  86. #include "stm32f4xx_tim.h"
  87. #include "stm32f4xx_usart.h"
  88. //#include "stm32f4xx_wwdg.h"
  89. #include "misc.h"
  90. /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */



  91. #if defined(STM32F40_41xxx)
  92. //#include "stm32f4xx_cryp.h"
  93. //#include "stm32f4xx_hash.h"
  94. //#include "stm32f4xx_rng.h"
  95. //#include "stm32f4xx_can.h"
  96. #include "stm32f4xx_dac.h"
  97. //#include "stm32f4xx_dcmi.h"
  98. //#include "stm32f4xx_fsmc.h"
  99. #endif /* STM32F40_41xxx */




  100. /* Exported types ------------------------------------------------------------*/
  101. /* Exported constants --------------------------------------------------------*/

  102. /* If an external clock source is used, then the value of the following define
  103.    should be set to the value of the external clock source, else, if no external
  104.    clock is used, keep this define commented */
  105. /*#define I2S_EXTERNAL_CLOCK_VAL   12288000 */ /* Value of the external clock in Hz */


  106. /* Uncomment the line below to expanse the "assert_param" macro in the
  107.    Standard Peripheral Library drivers code */
  108. /* #define USE_FULL_ASSERT    1 */

  109. /* Exported macro ------------------------------------------------------------*/
  110. #ifdef  USE_FULL_ASSERT

  111. /**
  112.   * @brief  The assert_param macro is used for function's parameters check.
  113.   * @param  expr: If expr is false, it calls assert_failed function
  114.   *   which reports the name of the source file and the source
  115.   *   line number of the call that failed.
  116.   *   If expr is true, it returns no value.
  117.   * @retval None
  118.   */
  119.   #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  120. /* Exported functions ------------------------------------------------------- */
  121.   void assert_failed(uint8_t* file, uint32_t line);
  122. #else
  123.   #define assert_param(expr) ((void)0)
  124. #endif /* USE_FULL_ASSERT */

  125. #endif /* __STM32F4xx_CONF_H */

  126. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
复制代码

六,点击构建工程按钮,编译工程。(如下图7所示) 105147f75it5522iytrq4t.png 图7七,点击窗口左下方仿真按钮,可见lcd2004一线屏和虚拟串口的信息显示在屏。 (如下图8,9,10所示) 105147zymtiism1rkt681i.png 图8 105147yn8zz2nizuw2drsr.png 图9 105148zrbho4mol9b1llb9.png 图10八,选择release,点击构建工程按钮,编译工程生成Hex文件。(如下图11所示) 105148lfd2o27b3l2hz37n.png 图11
附件在已安装Proteus8.9的计算机文件夹中打开即可
stm32_LCD2004单线仿真文件.rar (346.53 KB, 售价: 1 E币)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|ELEOK |网站地图

GMT+8, 2024-4-25 23:08

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表