当前位置:网站首页>基于msp430f2491的proteus仿真
基于msp430f2491的proteus仿真
2022-07-29 05:22:00 【半生烟火一世迷离】
用proteus仿真,用IAR编译生成hex文件下载(需要proteus与IAR的联合可以私信我)
msp430单片机与51单片机不一样。msp430单片机需要配置输入或者输出模式,然后才是高低电平的输出,并且配置之前需要关闭看门狗。并且不能像51单片机一样操作一位IO口只能操作8位IO口。
使端口P20的LED以500ms闪烁。
主函数
#include <msp430x24x.h>
#define LED8PORT P2OUT //P2接8个LED灯
#define LED8SEL P2SEL //P2接8个LED灯
#define LED8DIR P2DIR //P2接8个LED灯
//IAR软件的延时函数
#define CPU_F ((double)8000000)//8M
#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0)) //us延时
#define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0)) //ms延时
void Port_Init()
{
LED8SEL = 0x00; //设置IO口为普通I/O模式
LED8DIR = 0x01; //设置IO口P20的方向为输出
LED8PORT = 0x01; //P20口初始设置为高电平
}
void main()
{
WDTCTL = WDTPW + WDTHOLD;//关闭看门狗
Port_Init();
while(1)
{
LED8PORT = 0x01;//输出高电平
delay_ms(100);
LED8PORT =0x00;//输出低电平
delay_ms(100);
}
}
msp430最小系统proteus仿真图

边栏推荐
- 迁移学习笔记——Adapting Component Analysis
- How to use the pre training language model
- 基于STC51:四轴飞控开源项目原理图与源码(入门级DIY)
- 研究生新生培训第一周:深度学习和pytorch基础
- ABSA1: Attentional Encoder Network for Targeted Sentiment Classification
- Wechat built-in browser prohibits caching
- QT学习笔记-Excel的导入导出
- 迁移学习—— Transfer Feature Learning with Joint Distribution Adaptation
- GAN:生成对抗网络 Generative Adversarial Networks
- 一、PyTorch Cookbook(常用代码合集)
猜你喜欢

2022春招——禾赛科技FPGA技术岗(一、二面,收集于:数字IC打工人及FPGA探索者)
![[semantic segmentation] overview of semantic segmentation](/img/79/0c22bd28206fee281fa754c336b3b4.png)
[semantic segmentation] overview of semantic segmentation

Typical case of xdfs & Aerospace Institute HPC cluster

ML16-神经网络(2)

【Transformer】TransMix: Attend to Mix for Vision Transformers

iSCSI vs iSER vs NVMe-TCP vs NVMe-RDMA

MySQL inserts millions of data (using functions and stored procedures)

GAN:生成对抗网络 Generative Adversarial Networks

虚假新闻检测论文阅读(二):Semi-Supervised Learning and Graph Neural Networks for Fake News Detection

Review of neural network related knowledge (pytorch)
随机推荐
3、 How to customize data sets?
Migration learning notes - adaptive component analysis
HAL库学习笔记-12 SPI
神经网络相关知识回顾(PyTorch篇)
入门到入魂:单片机如何利用TB6600高精度控制步进电机(42/57)
1、 Focal loss theory and code implementation
Wechat built-in browser prohibits caching
2、 Multi concurrent interface pressure test
避坑:关于两个HC-05主从一体蓝牙模块互连,连不上问题
【Transformer】AdaViT: Adaptive Vision Transformers for Efficient Image Recognition
华为云14天鸿蒙设备开发-Day3内核开发
京微齐力:基于HMEP060的心率血氧模块开发(1:FPGA发送多位指令)
【Transformer】ACMix:On the Integration of Self-Attention and Convolution
【Transformer】SOFT: Softmax-free Transformer with Linear Complexity
Transfer learning
MarkDown简明语法手册
QT学习笔记-Qt Model/View
迁移学习——Transfer Joint Matching for Unsupervised Domain Adaptation
虚假新闻检测论文阅读(五):A Semi-supervised Learning Method for Fake News Detection in Social Media
GA-RPN:引导锚点的建议区域网络