-
大小: 34KB文件类型: .7z金币: 1下载: 0 次发布日期: 2021-05-12
- 语言: 其他
- 标签: MSP430G2553 TI CCS6.1 ADC10
资源简介
用CCS6.1开发的MSP430G2553Launchpad的ADC10程序,可以烧板。
代码片段和文件信息
#include
#include “DigitalTube.h“
/*
* main.c
*/
void main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
InitLEDPins();
/*
ADC10CTL0 = ADC10ON + REFON + ADC10SHT_2 + REF2_5V;
ADC10CTL1 = INCH_3 + SHS_0 + ADC10SSEL_2 + ADC10DIV_3 + CONSEQ_0;
ADC10AE0 = BIT3; // enable P1.3 analog input
*/
ADC10CTL0 |= ADC10ON + REFON + ADC10SHT_2 + REF2_5V + MSC + ADC10IE;
// ADC10SC;SMCLK;4分频;序列通道单次转换
ADC10CTL1 = SHS_0 + ADC10SSEL_2 + ADC10DIV_3 + CONSEQ_1;
ADC10CTL1 |= INCH_5;
ADC10DTC1 = 0X0C;
// enable P1.0~1.5 analog input
ADC10AE0 = BIT0+BIT1+BIT2+BIT3+BIT4+BIT5;
float result[6];
unsigned int temp[6];
unsigned int i;
for (i=0; i<6; i++)
{
result[i]=0.0;
temp[i]=0;
}
ADC10SA = (unsigned int)temp;
// for (i=0; i<0x3600; i++);
ADC10CTL0 |= ENC;
while (temp[5]==0)
{
ADC10CTL0 |= ADC10SC;
while ( ADC10CTL1 & ADC10BUSY == ADC10BUSY );
}
for (i=0; i<6; i++)
result[i] = (float)(temp[i])*4/1023 - 0.2;
while (1)
for (i=0; i<6; i++)
LED_Show( result[i] 1 500 );
}
相关资源
- UnrealProjectMenuRegistration.cmd
- LaunchPad MSP430G2553 官方例程 汉语注释
- 2018电子设计竞赛TI公司ADS1118keil源码
- AMD 补丁签名 ATIKMDAG-PATCHER
- [赛门铁克.BackupExec].Backup_Exec_2012_14.
- 利用msp430g2553进行串口通信
- Adam_ A Method for Stochastic Optimization.pdf
- STM32 的TIM 定时器参数计算工具
- A generic camera model and calibration……fi
- AD自定义丝印脚本
- MSP430G2553串口程序
- elfutils-libelf
- Solutions for Investment Science
- TkMybatis通用Mapper逆向工程代码生成工
- STC系列单片机的altium库文件
- The_Gamma_function
- MorphAnimation 5.5.0.unitypackage
- New Directions of Cryptograph《密码学新方向
- 基于opencv的retinex单尺度实现
-
Step Length Estimation Methods ba
sed on Ine - Springboot mybatis多数据源配置项目
- ConsoleApplication2
- 基于混沌的图像加密程序
- QtImage Qt编写的图片浏览器
- Windows 7程序开发系列之二JumpList篇2
- tiny210-uboot.bin
- Complete and robust no-fit polygon generation
- OptiX 155622H硬件介绍
- Stephen boyd convex optimization 视频及讲义
- ActiveXocx控件接口查看器
评论
共有 条评论