- 1、本文档共40页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
msp430与ADS1100(Msp430 and ADS1100)
msp430与ADS1100(Msp430 and ADS1100)
# include msp430x14x. H
# include lcd12864. H
# include ADS1100. H
Char tab0 [4] = {0};
Char tab1, [4] = {0};
Char tab2, [4] = {0};
Void Clock_Init ()
{
Uint I;
BCSCTL1 = ~ XT2OFF; / / open the XT oscillator
Do {
IFG1 = ~ OFIFG; / / clear the shock sign
For (I = 0; I 250; I + +)
_NOP (); / / delay waiting
}
While (IFG1 OFIFG)! = 0) / / if the flag is 1, continue to wait
BCSCTL2 = SELM1 + SELS; / / MCLK is 8 MHZ, SMCLK is 8 MHZ
}
Void WDT_Init ()
{
WDTCTL = WDTPW + WDTHOLD; / / close the guard dog
}
Void main (void)
{
WDT_Init (); / / close the dog
Clock_Init (); / / clock initialization
/ / keyport_init (); / / port definition
LCD_init (); / / liquid crystal parameter initialization Settings
LCD_clear ();
Clear_GDRAM ();
P3DIR = 0 XFF;
P3OUT = 0 XFF;
/ / P3OUT = 0 x00;
While (1)
{
Write_congf ();
Read_ads ();
Tab0 [0] = ((h % 1000/100) + 0x30);
Tab0 [1] = (h % 10/10) + 0x30);
Tab0 [2] = ((h % 10) + 0x30);
Tab1 [0] = ((l % 1000/100) + 0x30);
Tab1 [1] = ((l % 10/10) + 0x30);
Tab1, [2] = ((l % 10) + 0x30);
Tab2 [0] = ((config % 1000/100) + 0x30);
Tab2 [1] = ((config % 10/10) + 0x30);
Tab2 [2] = ((config % 10) + 0x30);
Display_string (0, 0, tab0);
Display_string (1, 0, tab1);
Display_string (2, 0, tab2);
Delay_ms (1000);
}
}
# include msp430x14x.h
# define CPU_F ((double) 8000000)
Define delay_us (x) __delay_cycles ((long) (CPU_F * (double) x / 1000000.0)
Define delay_ms (x) __delay_cycles ((long) (CPU_F * (double) x / 1000.0)
# define sda_in P1DIR = ~ (0x01) / / sda for input
# define sda_out P1DIR | = 0x01 / / sda for output
Define sda_l P1OUT = ~ (0x01) / / sda
Pound sign define sda_h P1OUT | = 0x01 / / sda height
# define scl_in P1DIR = ~ (0x02) / / SCL for input
# define scl_out P1DIR | = 0x02 / / SCL for output
Pound sign define scl_l P1OUT = ~ (0x02) / / SCL
Pound sign define scl_h P1OUT | = 0x02 / / SCL set high
Char h, l, config.
/ / initialize the
Void ADS1100_init ()
{
}
/ / start signal
Void ADS1100_start (void)
{
您可能关注的文档
- 2004监理工程师基本理论与相关法规真题(2004 supervision engineer basic theory and relevant regulations).doc
- 2004年南昌市物理中考试题及答案(2004 nanchang physics examination questions and answers).doc
- 2005年度中国电动车市场回顾(上)(China electric vehicle market review 2005 (top)).doc
- 2005年,空调企业斗什么(In 2005, what did air conditioning companies fight).doc
- 2005年二级建造师《建设工程法规及相关知识 》真题和答案(选择题)(2005 level ii constructor construction engineering regulations and related knowledge questions and answers (choice questions)).doc
- 2005年平安客户服务节已于5.28正式启动(In 2005, the ping an customer service festival was officially launched at 5.28).doc
- 2006年全市春季开学工作督查情况通报(In 2006, the city's spring opening work inspection briefing).doc
- 2006年南通市高三第一次调研测试 target=_blank(In 2006, the first research test of target = _blank was conducted in gao3, nantong).doc
- 2006年山东枣庄市中等学校招生考试(2006 shandong zaozhuang city secondary school entrance examination).doc
- 2006年度中国制造业500强(China's top 500 manufacturers in 2006).doc
文档评论(0)