- 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
- 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
- 3、此文档由网友上传,因疑似侵权的原因,本站不提供该文档下载,只提供部分内容试读。如果您是出版社/作者,看到后可认领文档,您也可以联系本站进行批量认领。
查看更多
ADC12 and DAC12 Modules - UAH(UAH ADC12和DAC12模块)
ADC12 and DAC12 Modules
by Alex Milenkovich, milenkovic@computer.org
Objective: This tutorial discusses the use of MSP430’s ADC12 and DAC12 peripheral devices.
Note: Required are all previous tutorials.
1. On-Chip Temperature Sensor
Let us consider a C application shown in Figure 1 that samples the on-chip temperature sensor,
converts the sampled voltage from the sensor to temperature in degrees Celsius and Fahrenheit,
and sends the temperature sensor through a RS232 link to the Hyper-terminal application. Note:
The source code for this program can be downloaded from the course secure directory (file
temp_uart.c).
Analyze the program and test it on the EasyWeb2 platform. Answer the following questions.
What does the program do?
How the basic block module is configured?
How the ADC12 module is configured?
How the USART0 module is configured?
// Description: fMCLK = fACLK = 8MHz
//
// MSP430F149
//
// /|\| XIN|-
// | | | XTAL (8Mhz)
// --|RST XOUT|-
// | |
// | P2.1|--LED
//
// @A. Milenkovic, milenkovic@computer.org
//
//******************************************************************************
#include msp430x14x.h
#include stdio.h
unsigned char thr_char; /* hold char from UART RX*/
unsigned char rx_flag; /* receiver rx status flag */
char gm1[67] = Hello! I am an MSP430. Would you like to know my temperature? (Y|N);
char gm2[9] = Bye, bye!;
char gm3[15] = Type in Y or N!;
long int temp;
long int IntDegF;
long int IntDegC;
char NewKey[25];
// initialize basic clock module
void InitOsc(void);
// UART Initializaion
void UART_Initialize(void);
//send char function
void UART0_putchar(char c);
void main(void)
{
int i = 0;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
InitOsc();
UART_Initialize();
ADC12CTL0 = SHT0_8 + REFON + ADC12ON;
A
您可能关注的文档
- A-3 SPECIFICATIONS REINFORCED CONCRETE (a - 3规格钢筋混凝土).pdf
- a world of grating solutions(一个光栅的解决方案的世界).pdf
- A. Determining Proportions with z Scores (答确定比例与z分数).pdf
- A. Introduction to Chemistry, Atoms and Elements(答介绍化学、原子和元素).pdf
- A Work Breakdown Structure for Implementing (工作分解结构实现).pdf
- A2100 COMMERCIAL SATELLITES INTEGRATED (A2100商业卫星综合).pdf
- A5 Safety Cat CH4 - BARA(A5安全猫CH4 -巴拉).pdf
- A380 Landing Gear and Systems – The feet of (A380降落装置和系统的脚).pdf
- a604 41te transmission repair - Bing - Download (a604 41 te传输修复- Bing下载).pdf
- AA, ICP-OES AND ICP-MS - PerkinElmer(AA,ICP-OES和icp - PerkinElmer).pdf
- Adaptive Modulation for OFDM-based Multiple (自适应调制OFDM-based多个).pdf
- Additive Manufacturing Challenges(加法制造的挑战).pdf
- Additives for Metalworking Fluids - Ivanhoe (金属加工液添加剂为艾芬豪).pdf
- Additional Information BLH Series - Oriental Motor(BLH系列东方马达的额外信息).pdf
- ADHESION - TAU(粘附-τ).pdf
- Adirondack Chair - content.wiltontool(阿迪朗达克椅子content.wiltontool).pdf
- ADIRONDACK Norm Abram’s CHAIR(阿迪朗达克规范亚伯兰的椅子上).pdf
- adjacent angles center of a sphere - Math Tutor (邻角球体的中心数学老师).pdf
- Adjacent Implants in the Anterior Maxilla - (相邻的植入前上颌骨-).pdf
- Adjustable Speed Drives - Automation(调速驱动器自动化).pdf
文档评论(0)