Proteus和Keil两个软件的联合使用
(1)Proteus画原理图(Proteus 8 Professional)

(2)Keil写代码:循环点亮LED灯(Keil uVision5)——这里我只用到了4个LED灯
写完源代码后,检查一下配置,使其能够在Output中输出hex文件。
(3)Keil中编译代码,生成*.hex文件

#include "stm32f10x.h"
void delay(unsigned int count)
{
unsigned int i;
for(;count!=0;count--)
{
i=5000;
while(i--);
}
}
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB

本文介绍了如何结合Proteus和Keil进行嵌入式开发,通过Proteus绘制STM32原理图,Keil编写并编译代码实现LED灯循环点亮。在Keil中配置生成.hex文件,然后在Proteus中加载并运行,最后展示了成功运行的效果。需要注意在Proteus中添加VDDA=VDD和VSSA=VSS的属性以避免错误。
最低0.47元/天 解锁文章
8703





