亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ads7871a.c

?? 文件是msp430單片機的ADS7871的程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
void TX_complete(void)
{
#if (SITE1)
      do
      {
      IFG1 &=~ UTXIFG0;
      }
      while (UTXIFG0 & IFG1); 
      delay(10);     
#else      
      do
      {
      IFG2 &=~ UTXIFG1;
      }
      while (UTXIFG1 & IFG2);
#endif
}       

/************************************************************/
/* Prototype - convert                                      */
/*                                                          */
/* !NA convert                                              */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV *                                                    */
/*  Description                                             */
/*  This prototype does the adc conversion                  */
/************************************************************/
void timer(void)
{ 
  TACTL = TASSEL1 + TACLR;              // SMCLK, Clear Tar
  CCR0 = 4-1;                         // PWM Period
  CCTL1 = OUTMOD_7;                     // CCR1 reset/set
  CCR1 = 2;                           // CCR1 PWM duty cycle
  TACTL |= MC0;                         // Start Timer_A in up mode
}

/************************************************************/
/* Prototype - delay                                        */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype gives a delay of around 1 second         */
/************************************************************/

void delay(int time)
      {
      unsigned int i;
      for (i = 0; i > time; i--);
      }  

/************************************************************/
/* Prototype - RESET_ADC                                    */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void RESET_ADC(void)
     {

#if HDW_RST
 P3OUT &= ~ADC_RST ;
 P3OUT |= ADC_RST ;
#else
P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
     U0TXBUF = REG0;   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
     TX_complete();       // Wait until all 8 bits have been received.
P3OUT |= ADC_CS ;      // Assert ADC_CS HIGH
#endif

      }  

/************************************************************/
/* Prototype - SET_R3                                       */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void SET_R3(int value)
      {
//while(1){

P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = REG3;   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (value);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
P3OUT |= ADC_CS ;      // Assert ADC_CS LOW
//}
      }

/************************************************************/
/* Prototype - SET_R3                                       */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void SET_R6(int value)
      {
//while(1){

P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = REG6;   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (value);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
P3OUT |= ADC_CS ;      // Assert ADC_CS LOW
//}
      }
      
/************************************************************/
/* Prototype - SET_R7                                       */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void SET_R7(int value)
      {
#if EXT_CLK
P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = (WRITE + REG7);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (value);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
P3OUT |= ADC_CS ;      // Assert ADC_CS HIGH
#else
P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = (WRITE + REG7);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (OSCR+OSCE+value);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
P3OUT |= ADC_CS ;      // Assert ADC_CS HIGH
#endif
delay(10);

      }
      
/************************************************************/
/* Prototype - SET_R24                                      */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void SET_R24(int value)
      {
//while(1){

P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = REG24;   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (value);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
P3OUT |= ADC_CS ;      // Assert ADC_CS LOW
//}
      }

/************************************************************/
/* Prototype - Read_REG                                       */
/*                                                          */
/* !NA delay                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype resets the ADS787x Device                */
/************************************************************/

void Read_REG(int REG)
      {
int value;
P3OUT &= ~ADC_CS ;      // Assert ADC_CS LOW
      U0TXBUF = (READ + REG);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      U0TXBUF = (0x00);   // Send clocks to the ADC, this shifts
                        //  in the first 8 bits of data.
      TX_complete();       // Wait until all 8 bits have been transmitted.
      value = U0RXBUF;
P3OUT |= ADC_CS ;      // Assert ADC_CS HIGH
delay(10);

      }
            
/************************************************************/
/* Prototype - flash                                        */
/*                                                          */
/* !NA flash                                                */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV i                                                    */
/*  Description                                             */
/*  This prototype indicates the program is complete        */
/************************************************************/
void display(void)
      {
      while(1)
            {
            P1OUT |= BIT0;          // Set P1.0
            delay(100);
            P1OUT &= ~BIT0;         // Clear P1.0
            delay(100);
            }       
      }
/************************************************************/
/* Prototype - convert                                      */
/*                                                          */
/* !NA convert                                              */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV *                                                    */
/*  Description                                             */
/*  This prototype does the adc conversion                  */
/************************************************************/      
void adc_convert (void)
{
//while(1){
#if DIRECTMODE
P3OUT &= ~ADC_CS ;                             // Assert ADC_CS LOW
     U0TXBUF = (DIRECT+GAIN01+SING0);                     // Send clocks to the ADC, this shifts 
					  //  in the first 8 bits of data.
      TX_complete();                         // Wait until all 8 bits have been transmitted.
 
P3OUT |= ADC_CS;                              // De-assert ADC_CS HIGH
#else
P3OUT &= ~ADC_CS ;                             // Assert ADC_CS LOW
//P3OUT |=  CONVERT;
//P3OUT &=  ~CONVERT;
     U0TXBUF = (REGISTER+WORD+WRITE+REG4);// Send clocks to the ADC, this shifts 
					  //  in the first 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been transmitted.
      U0TXBUF = (CNV_BSY+GAIN01+SING0);   // Send clocks to the ADC, this shifts
					  //  in the second 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been transmitted.           
      U0TXBUF = (0x0F & i);                 // Toggle GPIO's
					  //  in the second 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been transmitted.           

P3OUT |= ADC_CS;                          // De-assert ADC_CS HIGH
#endif
//}
}
      
/************************************************************/
/* Prototype - convert                                      */
/*                                                          */
/* !NA convert                                              */
/* !LA ANSI C                                               */
/* !PI *                                                    */
/* !PO *                                                    */
/* !LV *                                                    */
/*  Description                                             */
/*  This prototype does the adc conversion                  */
/************************************************************/      
void adc_read (int cnt)
{
unsigned int trash;

P3OUT &= ~ADC_CS ;                             // Assert ADC_CS LOW

      U0TXBUF = (READ+WORD+REG1);         // Send clocks to the ADC, this shifts 
					  //  in the first 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been transmitted.
      U0TXBUF = (0x00);                   // Send clocks to the ADC, this shifts
					  //  in the second 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been received.
      hi_byte = U0RXBUF;		  // Store this data in the hi-byte variable.

      U0TXBUF = (0x00);                   // Send clocks to the ADC, this shifts
					  //  in the second 8 bits of data.
      TX_complete();                      // Wait until all 8 bits have been received.           
      lo_byte = U0RXBUF;		  // Store this data in the lo-byte variable.
//Read_REG(3);
P3OUT |= ADC_CS;                          // De-assert ADC_CS HIGH
trash = U0RXBUF;			  // Clear the receiver
adc_hi = hi_byte << 8;                    // Left-shift the hi-byte 8-bits, to prepare 

if (ADS7871){                 			  //  for the second byte.
    adc_data[cnt] = (adc_hi + lo_byte)>>1;    // Join the hi-byte and the lo-byte together.
    }
if (ADS7870){
    adc_data[cnt] = (adc_hi + lo_byte)>>3;    // Join the hi-byte and the lo-byte together.
    }                                     
                                          	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产不卡一区视频| 国产乱码精品一区二区三| 天堂av在线一区| 国产不卡视频在线播放| 在线91免费看| 国产精品国产三级国产aⅴ中文| 日韩一区欧美二区| 91蝌蚪国产九色| 久久众筹精品私拍模特| 亚洲成人午夜电影| jizzjizzjizz欧美| 精品乱人伦一区二区三区| 亚洲一二三区视频在线观看| 丁香五精品蜜臀久久久久99网站| 日韩三级中文字幕| 三级在线观看一区二区| 91福利视频在线| 亚洲欧美日韩国产另类专区| 国产高清无密码一区二区三区| 8x8x8国产精品| 51精品国自产在线| 91丨九色丨蝌蚪丨老版| 九九九精品视频| 亚洲一区在线观看网站| 欧美精品一区二区三区高清aⅴ| 成a人片亚洲日本久久| 精品在线观看免费| 奇米888四色在线精品| 中文字幕日韩av资源站| 亚洲免费三区一区二区| 亚洲色图制服丝袜| 另类小说色综合网站| 91精品国产色综合久久久蜜香臀| 亚洲成av人在线观看| 欧美女孩性生活视频| 日韩中文字幕亚洲一区二区va在线 | 国产精品久久久久久妇女6080 | 91女神在线视频| 中文字幕在线播放不卡一区| 91老司机福利 在线| 亚洲一级片在线观看| 欧美区在线观看| 捆绑调教美女网站视频一区| 久久久影院官网| 91丝袜美腿高跟国产极品老师| 一区二区三区四区在线播放| 欧美美女一区二区在线观看| 久久国产精品色| 国产视频一区在线播放| 91免费看片在线观看| 日本成人在线不卡视频| 国产亚洲欧洲997久久综合 | 欧美一区二区三区电影| 狠狠狠色丁香婷婷综合激情| 国产精品乱人伦| 欧美性感一区二区三区| 狠狠久久亚洲欧美| 中文字幕中文字幕一区| 欧美精品99久久久**| 国产在线精品一区在线观看麻豆| 欧美激情中文字幕一区二区| 在线精品视频免费观看| 久久成人免费电影| 国产精品久久久久久久浪潮网站| 欧美三级视频在线播放| 国产一区二区网址| 亚洲精品国产品国语在线app| 日韩小视频在线观看专区| 成人h动漫精品| 一区二区三区四区乱视频| 波多野结衣在线一区| 久久精品无码一区二区三区| 国产九色sp调教91| 欧美一区二区三区四区视频| 一区二区三区在线影院| 成人中文字幕在线| 久久精品一区四区| 蜜臀av性久久久久蜜臀aⅴ四虎| 粉嫩av一区二区三区| 国产精品伦理一区二区| 国产精品久久久久婷婷| 欧美日韩精品是欧美日韩精品| 国产精品资源在线看| 亚洲一二三区不卡| 一区二区中文字幕在线| 久久久久国色av免费看影院| 欧美精品久久99久久在免费线 | 99麻豆久久久国产精品免费| 日韩一区欧美二区| 亚洲国产日韩综合久久精品| 国产精品麻豆欧美日韩ww| 精品国产欧美一区二区| 91精品午夜视频| 91国偷自产一区二区开放时间| 成人午夜精品一区二区三区| 激情图区综合网| 麻豆精品久久久| 日韩国产精品91| 亚洲高清一区二区三区| 亚洲午夜久久久久中文字幕久| 18欧美亚洲精品| 一区二区中文视频| 17c精品麻豆一区二区免费| 国产精品欧美综合在线| 国产精品少妇自拍| 国产精品理论在线观看| 国产精品国产三级国产有无不卡 | 久久青草欧美一区二区三区| 在线观看免费成人| 黄页网站大全一区二区| 国产精品网站一区| 91精品免费在线| 91在线你懂得| 狠狠色伊人亚洲综合成人| 亚洲色图视频网站| 精品国产123| 色哟哟国产精品| 日本乱人伦一区| 开心九九激情九九欧美日韩精美视频电影 | 色哟哟国产精品免费观看| 99国产精品国产精品毛片| 成人精品gif动图一区| 99精品国产99久久久久久白柏| 成人免费视频视频在线观看免费 | 国产午夜精品一区二区三区视频| 久久人人97超碰com| 国产精品天天看| 亚洲视频在线一区| 亚洲mv在线观看| 毛片av一区二区| 福利一区二区在线| 久久aⅴ国产欧美74aaa| 亚洲精品中文在线影院| 亚洲男人天堂一区| 日韩精品三区四区| 国产精品亚洲专一区二区三区| 成人激情免费视频| 欧美在线观看视频一区二区三区| 6080午夜不卡| 中文字幕精品在线不卡| 亚洲精品国产第一综合99久久| 亚洲成人综合网站| 国产精品1区2区| 欧美综合久久久| 久久久一区二区| 午夜在线电影亚洲一区| 国产剧情一区二区| 欧美在线观看一二区| 久久美女高清视频| 一区二区三区免费网站| 久久99蜜桃精品| 91免费看片在线观看| 26uuu亚洲| 性做久久久久久免费观看| 国产成人在线视频播放| 欧美专区日韩专区| 国产亚洲欧美激情| 婷婷综合五月天| 91麻豆视频网站| 欧美精品一区二区久久婷婷| 久久久久免费观看| 久草这里只有精品视频| 欧美日韩mp4| 国产成人av自拍| 制服视频三区第一页精品| 亚洲日本一区二区| 国产麻豆成人精品| 国产三级一区二区| 美女网站视频久久| 欧美一区二区三区四区五区| 亚洲精品乱码久久久久久黑人| 高清shemale亚洲人妖| 日本一区二区视频在线| 欧美天堂一区二区三区| 欧美日韩国产片| 最新不卡av在线| 成人精品国产一区二区4080| 日韩视频在线永久播放| 亚洲电影在线播放| 日本精品一区二区三区四区的功能| 国产亚洲欧美色| 国产一区不卡精品| 精品少妇一区二区三区日产乱码| 亚洲福利电影网| 欧美日韩国产不卡| 夜夜嗨av一区二区三区网页| 91天堂素人约啪| 亚洲人成精品久久久久久 | 国产成人精品一区二| 日韩免费视频线观看| 蜜臀精品一区二区三区在线观看| 3d动漫精品啪啪1区2区免费| 一区二区三区**美女毛片| 欧洲av在线精品| 天堂va蜜桃一区二区三区漫画版| 欧美探花视频资源| 天天av天天翘天天综合网色鬼国产 | 日韩精品中文字幕在线不卡尤物| 日韩av一区二区三区四区| 日韩三级中文字幕|