一,打開(kāi)文件(可以隨文下載放置在文檔中打開(kāi))。(如下圖1所示)
105144l3ab9kdbdcdsd923.png (732.69 KB)
下載附件
2021-4-17 01:36 上傳
圖1二,調(diào)整原理圖大小,適合可視,另存工程文件。(如下圖2,3,4所示)
105145qz5mw8zzom5fewzz.png (252.46 KB)
下載附件
2020-5-23 01:06 上傳
圖2
105145pq0qosy57u0cyuuy.png (300.21 KB)
下載附件
2020-5-23 01:06 上傳
圖3
105145z1nlrbmblmzb7mr4.png (377.96 KB)
下載附件
2020-5-23 01:06 上傳
圖4三,點(diǎn)擊Source Code標(biāo)簽。(如下圖5所示)
105146gz3y35v3szqq3lcp.png (190.1 KB)
下載附件
2020-5-23 01:06 上傳
圖5四,編輯main.c 代碼如Proteus8.9 VSM Studio GCC編譯器仿真STM32F407ZGT6系列015_lcd2004一線屏(如下圖6所示)
105147nqi1akxcuv5vwszz.png (210.55 KB)
下載附件
2020-5-23 01:06 上傳
圖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); //初始化延時(shí)函數(shù)
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//設(shè)置系統(tǒng)中斷優(yōu)先級(jí)分組2
- uart_init(9600);//初始化串口波特率為115200
-
-
- while(1) //實(shí)現(xiàn)比較值從0-300遞增,到300后從300-0遞減,循環(huán)
- {
-
- 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****/
復(fù)制代碼
六,點(diǎn)擊構(gòu)建工程按鈕,編譯工程。(如下圖7所示)
105147f75it5522iytrq4t.png (346.97 KB)
下載附件
2020-5-23 01:06 上傳
圖7七,點(diǎn)擊窗口左下方仿真按鈕,可見(jiàn)lcd2004一線屏和虛擬串口的信息顯示在屏。 (如下圖8,9,10所示)
105147zymtiism1rkt681i.png (381.27 KB)
下載附件
2020-5-23 01:06 上傳
圖8
105147yn8zz2nizuw2drsr.png (172.21 KB)
下載附件
2020-5-23 01:06 上傳
圖9
105148zrbho4mol9b1llb9.png (388.1 KB)
下載附件
2020-5-23 01:06 上傳
圖10八,選擇release,點(diǎn)擊構(gòu)建工程按鈕,編譯工程生成Hex文件。(如下圖11所示)
105148lfd2o27b3l2hz37n.png (409.05 KB)
下載附件
2020-5-23 01:06 上傳
圖11
附件在已安裝Proteus8.9的計(jì)算機(jī)文件夾中打開(kāi)即可
stm32_LCD2004單線仿真文件.rar
(346.53 KB, 售價(jià): 1 E幣)
【必讀】版權(quán)免責(zé)聲明
1、本主題所有言論和內(nèi)容純屬會(huì)員個(gè)人意見(jiàn),與本論壇立場(chǎng)無(wú)關(guān)。2、本站對(duì)所發(fā)內(nèi)容真實(shí)性、客觀性、可用性不做任何保證也不負(fù)任何責(zé)任,網(wǎng)友之間僅出于學(xué)習(xí)目的進(jìn)行交流。3、對(duì)提供的數(shù)字內(nèi)容不擁有任何權(quán)利,其版權(quán)歸原著者擁有。請(qǐng)勿將該數(shù)字內(nèi)容進(jìn)行商業(yè)交易、轉(zhuǎn)載等行為,該內(nèi)容只為學(xué)習(xí)所提供,使用后發(fā)生的一切問(wèn)題與本站無(wú)關(guān)。 4、本網(wǎng)站不保證本站提供的下載資源的準(zhǔn)確性、安全性和完整性;同時(shí)本網(wǎng)站也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的損失或傷害。 5、本網(wǎng)站所有軟件和資料均為網(wǎng)友推薦收集整理而來(lái),僅供學(xué)習(xí)用途使用,請(qǐng)務(wù)必下載后兩小時(shí)內(nèi)刪除,禁止商用。6、如有侵犯你版權(quán)的,請(qǐng)及時(shí)聯(lián)系我們(電子郵箱1370723259@qq.com)指出,本站將立即改正。
|