Proper sequence to read 2 adc channel .

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Proper sequence to read 2 adc channel .

1,089件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by aamir ali on Thu Aug 01 01:41:05 MST 2013
Hi,
I want to scan two adc channels continuously not in burst mode, but in software controlled mode. Should I disable start bit after 1 channel & re enable start bit before second channel. Is it correct way

while(1)
{
/* scan channel 1 */
   LPC_ADC->CR = 0x00000601;   // select channel one
   LPC_ADC->CR = (LPC_ADC->CR & 0x0FC1FFFF) | (BIT_24);   // enable start conversion
   
   while(!(LPC_ADC->STAT & 0x00000001));                  // wait while conversion
   // read the value of channel 1

   LPC_ADC->CR = (LPC_ADC->CR & 0x0FC1FFFF) & (~(BIT_24));   //disable start bit   is it necessary here


/* scan channel 2 */
   LPC_ADC->CR = 0x00000602;   // select channel one
   LPC_ADC->CR = (LPC_ADC->CR & 0x0FC1FFFF) | (BIT_24);   // enable start conversion
   
   while(!(LPC_ADC->STAT & 0x00000002));                  // wait while conversion
   // read the value of channel 2   
   LPC_ADC->CR = (LPC_ADC->CR & 0x0FC1FFFF) & (~(BIT_24));   //disable start bit   is it necessary here

}
ラベル(1)
0 件の賞賛
返信
1 返信

1,050件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by aamir ali on Sun Aug 04 22:35:07 MST 2013
any help on that..........
0 件の賞賛
返信