一,打开文件(可以随文下载放置在文档中打开)。(如下图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 代码:- /* Main.c file generated by New Project wizard
- * Author: Ziegler Yin
- * Created: 周四 一月 16 2020
- * Processor: STM32F407ZGT6ZGT6
- * Compiler: GCC for ARM
- */
- #include "mfuncs.h"
- #include "delay.h"
- #include "usart.h"
- #include "comds.h"
- u8 l;
- int main(void)
- {
- delay_init(84); //初始化延时函数
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
- uart_init(9600);//初始化串口波特率为115200
-
-
- while(1) //实现比较值从0-300递增,到300后从300-0递减,循环
- {
-
- init();
- wrt_lin('0');
- uprint("Kaillen WorkWork
- ");
- wrt_lin('1');
- uprint(" Wellcom YOU!
- ");
- for(l=0; l<255; l++) delay_ms(15);
- wrt_lin('2');
- uprint(" Code Made
- ");
- wrt_lin('3');
- uprint(" ---Ziegler Yin
- ");
- for(l=0; l<100; l++) delay_ms(15);
- }
- }
- stm32f4xx_conf.h:
- /**
- ******************************************************************************
- * @file Project/STM32F4xx_StdPeriph_Templates/stm32f4xx_conf.h
- * @author MCD Application Team
- * @version V1.8.0
- * @date 04-November-2016
- * @brief Library configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
- *
- * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.st.com/software_license_agreement_liberty_v2
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************
- */
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef __STM32F4xx_CONF_H
- #define __STM32F4xx_CONF_H
- /* Includes ------------------------------------------------------------------*/
- /* Uncomment the line below to enable peripheral header file inclusion */
- //#include "stm32f4xx_adc.h"
- //#include "stm32f4xx_crc.h"
- #include "stm32f4xx_dbgmcu.h"
- //#include "stm32f4xx_dma.h"
- #include "stm32f4xx_exti.h"
- //#include "stm32f4xx_flash.h"
- #include "stm32f4xx_gpio.h"
- //#include "stm32f4xx_i2c.h"
- //#include "stm32f4xx_iwdg.h"
- #include "stm32f4xx_pwr.h"
- #include "stm32f4xx_rcc.h"
- //#include "stm32f4xx_rtc.h"
- //#include "stm32f4xx_sdio.h"
- //#include "stm32f4xx_spi.h"
- #include "stm32f4xx_syscfg.h"
- #include "stm32f4xx_tim.h"
- #include "stm32f4xx_usart.h"
- //#include "stm32f4xx_wwdg.h"
- #include "misc.h"
- /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
- #if defined(STM32F40_41xxx)
- //#include "stm32f4xx_cryp.h"
- //#include "stm32f4xx_hash.h"
- //#include "stm32f4xx_rng.h"
- //#include "stm32f4xx_can.h"
- #include "stm32f4xx_dac.h"
- //#include "stm32f4xx_dcmi.h"
- //#include "stm32f4xx_fsmc.h"
- #endif /* STM32F40_41xxx */
- /* Exported types ------------------------------------------------------------*/
- /* Exported constants --------------------------------------------------------*/
- /* If an external clock source is used, then the value of the following define
- should be set to the value of the external clock source, else, if no external
- clock is used, keep this define commented */
- /*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */
- /* Uncomment the line below to expanse the "assert_param" macro in the
- Standard Peripheral Library drivers code */
- /* #define USE_FULL_ASSERT 1 */
- /* Exported macro ------------------------------------------------------------*/
- #ifdef USE_FULL_ASSERT
- /**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
- /* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
- #else
- #define assert_param(expr) ((void)0)
- #endif /* USE_FULL_ASSERT */
- #endif /* __STM32F4xx_CONF_H */
- /************************ (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币)
【必读】版权免责声明
1、本主题所有言论和内容纯属会员个人意见,与本论坛立场无关。2、本站对所发内容真实性、客观性、可用性不做任何保证也不负任何责任,网友之间仅出于学习目的进行交流。3、对提供的数字内容不拥有任何权利,其版权归原著者拥有。请勿将该数字内容进行商业交易、转载等行为,该内容只为学习所提供,使用后发生的一切问题与本站无关。 4、本网站不保证本站提供的下载资源的准确性、安全性和完整性;同时本网站也不承担用户因使用这些下载资源对自己和他人造成任何形式的损失或伤害。 5、本网站所有软件和资料均为网友推荐收集整理而来,仅供学习用途使用,请务必下载后两小时内删除,禁止商用。6、如有侵犯你版权的,请及时联系我们(电子邮箱1370723259@qq.com)指出,本站将立即改正。
|