资源简介
*MSP430F55xx_ADC多通道多次转换串口发送数据
*序列通道多次转换,这里以8个数为一个周期,通过串口打印A0~3的8次采样电压值
*串口配置P3.3 P3.4 TXD/RXD 波特率9600
MSP430F552x
-----------------
/|\| |
| | |
--|RST |
| |
Vin0 -->|P6.0/CB0/A0 |
Vin1 -->|P6.1/CB1/A1 |
Vin2 -->|P6.2/CB2/A2 |
Vin3 -->|P6.3/CB3/A3 |

代码片段和文件信息
/* --COPYRIGHT--BSD_EX
*序列通道多次转换,这里以8个数为一个周期,通过串口打印A0~3的8次采样电压值
*串口配置P3.3 P3.4 TXD/RXD 波特率9600
//
// MSP430F552x
// -----------------
// /|\| |
// | | |
// --|RST |
// | |
// Vin0 -->|P6.0/CB0/A0 |
// Vin1 -->|P6.1/CB1/A1 |
// Vin2 -->|P6.2/CB2/A2 |
// Vin3 -->|P6.3/CB3/A3 |
// | |
//******************************************************************************
#include
#define Num_of_Results 8
unsigned int i;
volatile unsigned int A0results[Num_of_Results];
volatile unsigned int A1results[Num_of_Results];
volatile unsigned int A2results[Num_of_Results];
volatile unsigned int A3results[Num_of_Results];
/*UART初始化 P3.3 P3.4 TXD/RXD 9600*/
void usartInit(){
P3SEL = BIT3+BIT4; // P3.34 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 6; // 1MHz 9600 (see User‘s Guide)
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS_0 + UCBRF_13 + UCOS16; // Modln UCBRSx=0 UCBRFx=0
// over sampling
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
}
/*UART发送单字符c*/
void sendChar(char c){
UCA0TXBUF=c;
while(!(UCA0IFG&UCTXIFG));//等待数据发送完毕
}
/*UART发送字符串p*/
void sendString(unsigned char *p)
{
while(*p!=‘\0‘){
UCA0TXBUF=*p++;
while(!(UCA0IFG&UCTXIFG));//等待数据发送完毕
}
}
/*整型d转字符串UART发送*/
void int_string(int iint nint d){
unsigned char s[] = “0000“;
unsigned char *p;
int bits=0ten = 0hundred = 0thousand = 0;
thousand = d/1000;
hundred = d%1000/100;
ten = d%100/10;
bits = d%10;
s[0]=thousand+‘0‘;
s[1]=hundred+‘0‘;
s[2]=ten+‘0‘;
s[3]=bits+‘0‘;
p = s;
sendChar(n+‘0‘);
sendChar(‘[‘);
sendChar(i+‘0‘);
sendString(“] is : “);
sendString(p);
sendString(“\r\nThe A“);
}
void ADCInit(){
P6SEL = 0x0F; // Enable A/D channel inputs
ADC12CTL0 = ADC12ON+ADC12MSC+ADC12SHT0_8; // Turn on ADC12 extend sampling time
// to avoid overflow of results
ADC12CTL1 = ADC12SHP+ADC12CONSEQ_3; // Use sampling timer repeated sequence
ADC12MCTL0 = ADC12INCH_0; // ref+=AVcc channel = A0
ADC12MCTL1 = ADC12INCH_1; // ref+=AVcc channel = A1
ADC12MCTL2 = ADC12INCH_2; // ref+=AVcc channel = A2
ADC12MCTL3 = ADC12INCH_3+ADC12EOS; // ref+=AVcc channel = A3 end seq.
ADC12IE = 0x08; // Enable ADC12IFG.3
ADC12CTL0 |= ADC12ENC; // En
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-26 15:47 MSP430F55xx_adc_06.c\
文件 442 2019-07-25 14:53 MSP430F55xx_adc_06.c\.ccsproject
文件 28623 2019-07-25 14:53 MSP430F55xx_adc_06.c\.cproject
目录 0 2019-07-26 15:47 MSP430F55xx_adc_06.c\.launches\
文件 5157 2019-07-26 15:51 MSP430F55xx_adc_06.c\.launches\MSP430F55xx_adc_06.c.launch
文件 850 2019-07-25 14:53 MSP430F55xx_adc_06.c\.project
目录 0 2019-07-26 15:46 MSP430F55xx_adc_06.c\.settings\
文件 62 2019-07-25 14:53 MSP430F55xx_adc_06.c\.settings\org.eclipse.cdt.codan.core.prefs
文件 123 2019-07-25 14:53 MSP430F55xx_adc_06.c\.settings\org.eclipse.cdt.debug.core.prefs
文件 208 2019-07-26 15:46 MSP430F55xx_adc_06.c\.settings\org.eclipse.core.resources.prefs
目录 0 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\
文件 73 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\ccsObjs.opt
文件 4640 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\makefile
文件 97416 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\MSP430F55xx_adc_06.c.map
文件 60964 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\MSP430F55xx_adc_06.c.out
文件 240596 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\MSP430F55xx_adc_06.c_li
文件 921 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\MSP430F55xx_adc_06.d
文件 19788 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\MSP430F55xx_adc_06.obj
文件 260 2019-07-26 15:46 MSP430F55xx_adc_06.c\Debug\ob
文件 2073 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\sources.mk
文件 1112 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\subdir_rules.mk
文件 614 2019-07-26 15:51 MSP430F55xx_adc_06.c\Debug\subdir_vars.mk
文件 14573 2019-07-25 14:53 MSP430F55xx_adc_06.c\lnk_msp430f5529.cmd
文件 5720 2019-07-26 15:53 MSP430F55xx_adc_06.c\MSP430F55xx_adc_06.c
目录 0 2019-07-25 14:53 MSP430F55xx_adc_06.c\targetConfigs\
文件 822 2019-07-25 14:53 MSP430F55xx_adc_06.c\targetConfigs\MSP430F5529.ccxm
文件 806 2019-07-25 14:53 MSP430F55xx_adc_06.c\targetConfigs\readme.txt
相关资源
- IAR for MSP430 v7.10.1 注册机
- 基于MSP430G2553的蓝牙控制小车
- 单片机和adc0809数字电压表
- 单片机、ADC0808809设计简易数字电压表
- 利用DS1302和msp430进行闹钟和万年历的
- msp430F149操作红外接收模块源码
- [免费]msp430f149控制PS2键盘并用1602显示
- 数据采集系统——ADC0808的应用,单片
- MSP430f149读sd FAT txt
- ADC0809数字电压表 LCD1602显示 汇编程序
- 数字电压表(源程序 protues仿真)
- stm32通过DMA方式采集ADC数据
- 多通道数据采集.vi(labview)
- broadcom phy BCM5482S datasheet(开发用)
- ADC0808工作时序图
- fpga多通道采样
- 用8位spi实现16位spi
- 基于MSP430单片机的实时多任务操作系
- bcm5482 datasheet
- broadcom 802.11g 网络适配器驱动程序 v
- STM32F103VCT6TR - High-density performance lin
- AT89C51+ADC0808 PROTEUS仿真
- 基于51单片机的多通道数据采集范围控
- ADC0832ADC0809DAC0832三种芯片程序,c程序
- 数据采集系统——ADC0808的应用
- 超声处理原位反应合成Al2O3/ADC12复合材
- STM32AD采集DA还原
- 以单片机AT89S52、光电脉宽调制器芯片
- 基于SVM及两类运动想象的多通道特征
- MSP430系列单片机例程(msp430f235)
评论
共有 条评论