AnsweredAssumed Answered

A/D Driver Unable to Open Channel

Question asked by Ali2006 on Aug 17, 2012
Latest reply on Jun 27, 2013 by Myke Predko

 

I have 5 A/D channels all various channels of ADC1.   If I try to initialize any channel that is on the ADC1_SOURCE_AD19 or ADC1_SOURCE_AD20  the system comes back with a failed attempt.  If I try ADC1_SOURCE_AD0 it works just fine.  Problem is that I need AD19 and AD20 as that is where the hardware has the values.. 

 

I'm trying to single step through the fopen driver for the ADC to see where the error is.. but the IDE for the debugger keeps crashing on me.

#define MY_TRIGGER            ADC_PDB_TRIGGER  //Trigger Used for Every Channel// Logical channel init struct - ADC1_AD19 - EX_ANALOG_1 const ADC_INIT_CHANNEL_STRUCT Ex1_ch_param = {    ADC1_SOURCE_AD19,          // Physical ADC channel    ADC_CHANNEL_MEASURE_LOOP | ADC_CHANNEL_START_TRIGGERED,    // Runs continuously after IOCTL trigger    1,                        // Number of samples in one run sequence    0,                        // Time offset from trigger point in us    100000,                   // Period in us (= 0.1 sec)    0x10000,                  // Scale range of result (not used now)    1,                        // Circular buffer size (sample count)    MY_TRIGGER,               // Logical trigger ID that starts this ADC channel    &adcEvent,                // lwevent Object    ADC_DATA_READY_MASK       // lwevent Mask to be set when complete. };// Logical channel init struct - ADC1_AD0 - Heat Seal  const ADC_INIT_CHANNEL_STRUCT HeatSeal_ch_param = {    ADC1_SOURCE_AD0,         // Physical ADC channel    ADC_CHANNEL_MEASURE_LOOP | ADC_CHANNEL_START_TRIGGERED,    // Runs continuously after IOCTL trigger    1,                        // Number of samples in one run sequence    0,                        // Time offset from trigger point in us    100000,                   // Period in us (= 0.1 sec)    0x10000,                  // Scale range of result (not used now)    1,                        // Circular buffer size (sample count)    MY_TRIGGER,               // Logical trigger ID that starts this ADC channel    NULL,                     // lwevent Object    0                         // lwevent Mask to be set when complete. };   // Open the ADC device   adc = fopen(ADC_STR, (const char*)&adc_init);   if (adc == NULL)   {      printf("\nADC_Task: Open ADC device failed!\n");      _task_block();   }   // Open and Initialize the ADC Channels.    adc_ex1 = fopen(EX1_STR, (const char*)&Ex1_ch_param);   if (adc_ex1 == NULL)   {      printf("\nADC_Task: Open ADC channel for EX1 failed!\n");      //_task_block();   }    // Open and Initialize the ADC Channels.    adc_hs = fopen(HS_STR, (const char*)&HeatSeal_ch_param);   if (adc_hs == NULL)   {      printf("\nADC_Task: Open ADC channel for Heat Seal failed!\n");      // _task_block();   }   ......

 

Any thoughts on my ADC error or the crashing Debugger would be helpful?

 

FYI.. I'm using a K70 ad the P&E Multilink Universal Debugger under CodeWarrior 10.2 with MQX 3.8.

 

Thanks.

 

 

Outcomes