当前位置:网站首页>基于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仿真图
边栏推荐
- 噪音监测传感系统
- Flink connector Oracle CDC synchronizes data to MySQL in real time (oracle12c)
- HAL库学习笔记-11 I2C
- ML8自学笔记-LDA原理公式推导
- [target detection] KL loss: bounding box progression with uncertainty for accurate object detection
- PyTorch的数据读取机制
- NLP领域的AM模型
- 预训练语言模型的使用方法
- 电力电子:单项逆变器设计(MATLAB程序+AD原理图)
- ABSA1: Attentional Encoder Network for Targeted Sentiment Classification
猜你喜欢
华为云14天鸿蒙设备开发-Day5驱动子系统开发
二、OCR训练时,将txt文件和图片数据转为lmdb文件格式
一、常见损失函数的用法
ML9自学笔记
【Transformer】TransMix: Attend to Mix for Vision Transformers
The third week of postgraduate freshman training: resnet+resnext
HAL库学习笔记-13 I2C和SPI的应用
NLP领域的AM模型
华为云14天鸿蒙设备开发-Day7WIFI功能开发
2、 During OCR training, txt files and picture data are converted to LMDB file format
随机推荐
Fasttext learning - text classification
Reading papers on false news detection (I): fake news detection using semi supervised graph revolutionary network
[target detection] generalized focal loss v1
GA-RPN:引导锚点的建议区域网络
The differences and reasons between MySQL with and without quotation marks when querying string types
MySQL inserts millions of data (using functions and stored procedures)
零基础学FPGA(五):时序逻辑电路设计之计数器(附有呼吸灯实验、简单组合逻辑设计介绍)
京微齐力:基于HMEP060的心率血氧模块开发(1:FPGA发送多位指令)
ML16-神经网络(2)
NLP领域的AM模型
噪音监测传感系统
[target detection] KL loss: bounding box progression with uncertainty for accurate object detection
京微齐力:基于HMEP060的OLED字符显示(及FUXI工程建立演示)
ML6自学笔记
1、 Combine multiple txt files into one TXT file
Wechat built-in browser prohibits caching
一、网页端文件流的传输
三、如何读取视频?
虚假新闻检测论文阅读(一):Fake News Detection using Semi-Supervised Graph Convolutional Network
备份谷歌或其他浏览器插件