国产免费AV|泡泡玛特欧洲总部将设在伦敦|中文天堂网www新版资源在线|一本久道综合在线中文|国精产品一二三产区的使用方法|香蕉鱼在线观看|www.27eee

ELEOK

標題: Proteus仿真STM32F407ZGT6單線控制lcd2004液晶屏 [打印本頁]

作者: 路漫漫    時間: 2020-5-23 01:25
標題: Proteus仿真STM32F407ZGT6單線控制lcd2004液晶屏
一,打開文件(可以隨文下載放置在文檔中打開)。(如下圖1所示) 圖1二,調整原理圖大小,適合可視,另存工程文件。(如下圖2,3,4所示) 圖2 圖3 圖4三,點擊Source Code標簽。(如下圖5所示) 圖5四,編輯main.c 代碼如Proteus8.9 VSM Studio GCC編譯器仿真STM32F407ZGT6系列015_lcd2004一線屏(如下圖6所示) 圖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所示) 圖7七,點擊窗口左下方仿真按鈕,可見lcd2004一線屏和虛擬串口的信息顯示在屏。 (如下圖8,9,10所示) 圖8 圖9 圖10八,選擇release,點擊構建工程按鈕,編譯工程生成Hex文件。(如下圖11所示) 圖11
附件在已安裝Proteus8.9的計算機文件夾中打開即可
stm32_LCD2004單線仿真文件.rar (346.53 KB, 售價: 1 E幣)





歡迎光臨 ELEOK (http://www.afoofa.cn/) Powered by Discuz! X5.0