AnsweredAssumed Answered

LWADC on ADC1SE9 possible?

Question asked by AaronBusca on Oct 10, 2014
Latest reply on Oct 31, 2014 by AaronBusca

Hi,

 

I'm trying to use LWADC driver for ADC1SE9 channel for the VF6XX with MQX 4.1.1 for Linux. I have the following initialization:

 

if (!_lwadc_init(&lwadc1_init))
{
  printf("Failed to initialize ADC\n");
}

if (!_lwadc_init_input(&ntc_input, ADC_INPUT_ADC1_AN9))
{
  printf("Failed to initialize ADC input\n");
}

 

But it's failing in _lwadc_init_input function.

Debugging the code, I could find that the _bsp_adc_channel_io_init function uses an array of available ADC channels:

 

static const uint16_t adc_pin_map[ADC_NUM_DEVICES][ADC_HW_CHANNELS] = {
   {
      LWADC0_AN0,
      LWADC0_AN1,
      LWADC0_AN2,
      LWADC0_AN3,
      LWADC0_AN4,
      LWADC0_AN5,
      LWADC0_AN6,
      LWADC0_AN7,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
   },
      {
      LWADC1_AN0,
      LWADC1_AN1,
      LWADC1_AN2,
      LWADC1_AN3,
      LWADC1_AN4,
      LWADC1_AN5,
      LWADC1_AN6,
      LWADC1_AN7,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
      LWADC_SIG_NC,
   }
};

 

There are just the channels 0 to 7.

 

Is this a limitation or can I edit that code in order to enable ADC1SE9 channel for LWADC driver?

Outcomes