当前位置:网站首页>基于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仿真图

边栏推荐
- ML16-神经网络(2)
- 2、 Summary of deep learning data enhancement methods
- Wechat built-in browser prohibits caching
- ROS教程(Xavier)
- 逻辑回归-项目实战-信用卡检测任务(下)
- 虚假新闻检测论文阅读(三):Semi-supervised Content-based Detection of Misinformation via Tensor Embeddings
- Am model in NLP field
- AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- [image classification] how to use mmclassification to train your classification model
- 引入Spacy模块出错—OSError: [E941] Can‘t find model ‘en‘.
猜你喜欢

Wechat built-in browser prohibits caching

Review of neural network related knowledge (pytorch)

京微齐力:基于HMEP060的心率血氧模块开发(1:FPGA发送多位指令)

电脑视频暂停再继续,声音突然变大

How to perform POC in depth with full flash distribution?

Transfer feature learning with joint distribution adaptation

避坑:关于两个HC-05主从一体蓝牙模块互连,连不上问题

神经网络相关知识回顾(PyTorch篇)

4、 Application of one hot and loss function

ReportingService WebService form authentication
随机推荐
ML8自学笔记
四、One-hot和损失函数的应用
ReportingService WebService form authentication
ML16 neural network (2)
[semantic segmentation] Introduction to mapillary dataset
Migration learning notes - adaptive component analysis
PyTorch的数据读取机制
QT学习笔记-Excel的导入导出
一、PyTorch Cookbook(常用代码合集)
ML17-神经网络实战
预训练语言模型的使用方法
QT学习笔记-数据管理系统设计实现
Transformer review + understanding
华为云14天鸿蒙设备开发-Day5驱动子系统开发
[network design] convnext:a convnet for the 2020s
Typical cases of xdfs & China Daily Online Collaborative Editing Platform
一、网页端文件流的传输
Reading papers on false news detection (I): fake news detection using semi supervised graph revolutionary network
迁移学习——Transitive Transfer Learning
Migration learning - geodesic flow kernel for unsupervised domain adaptation