Parallell mode ADC in MCF52221 using Processor Expoerts ADC-bean.

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

Parallell mode ADC in MCF52221 using Processor Expoerts ADC-bean.

749件の閲覧回数
AnteOO
Contributor II

Hi guys!

 

You know if it is possible to use the ADC-bean to measure Once Parallell simultaneous on two channels, let's say channel 2 anc 5 (on separate S/H-circuits ), and during the program runs, I want to change which cannels, to for say 3 and 6. Is there a method, or an easy way to do this using Processor Expert ? I know it's possible if i didn't have to change which cannel is measured, but it's crucial that I may change it at an arbitary time.

 

Hope you have any ideas!

 

Thanks!

Andreas

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

337件の閲覧回数
ProcessorExpert
Senior Contributor III

Hello,

 

unfortunately, the ADC bean does not support switching channels for simultaneous measurement, however, as it has been suggested in previous posts, you can switch by directly writing to ADC registers before each measurement. But please note that this is possible only if you have disabled individual channel accessing method like MeasureChan.

 

For example, to switch to channels 3 and 6:

 

void main(void)
{

....

  (void)AD1_Measure(TRUE);
 
  /* ADLST1: ??=0,SAMPLE3=0,??=0,SAMPLE2=0,??=0,SAMPLE1=0,??=0,SAMPLE0=3 */
  setReg16(ADLST1,0x03);               /* Set ADC channel list reg. */
  /* ADLST2: ??=0,SAMPLE7=0,??=0,SAMPLE6=0,??=0,SAMPLE5=0,??=0,SAMPLE4=6 */
  setReg16(ADLST2,0x06);               /* Set ADC channel list reg. */

  (void)AD1_Measure(TRUE);
.....

 

best regards
Petr Hradsky
Processor Expert Support Team

0 件の賞賛

337件の閲覧回数
AnteOO
Contributor II

Is it possible to just write a method that changes ADLST1 / ADLST2-registers to just put the channel you want in queue and then use the generated Start-method by the ADC-bean ? Or am I overlooking something?

0 件の賞賛