S32K144x  Schematic and ADC firmware do not match.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144x  Schematic and ADC firmware do not match.

1,069 Views
saurabhkarnik
Contributor I

I am working on the eval board for S32K144x 100 pin package board. I looked at the schematic and it said that the potentiometer is connected to ADC0_SE12. However when i look at any example code the , especially the software triggered one, i find that the adc challel is listed as 11. Is there a GAP between the 2. I tried the software trigger code and the raw value changes according to the potentiomenter. 

adc_chan_config_t adConv1_ChnConfig0 = {
.interruptEnable = false,
.channel = ADC_INPUTCHAN_AD11,
};

Am i missing something here? 

0 Kudos
3 Replies

916 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

Hi saurabhkarnik‌,

What SDK version are you using? I searched in latest versions and RTM , and see that the selected input channel is AD12, as would be expected.

Possibly this was an issue in earlier SDK versions, or a hardware change in EVB boards.


Still, getting valid raw data with AD11 is interesting. I will try to find if the potentiometer was indeed set to AD11 at some point.

0 Kudos

916 Views
saurabhkarnik
Contributor I

I checked the firmware and seems we do change the value to 12 later. Maybe

the SDK needs to be udated or i am on previous version not sure. However it

works fine. My next question is if i want to trigger a software conversion

on 1st channel of ADC1 what would be the mask. Would it be channel 16+

assuming channels 0-15 are on ADC0 and 16+ are on ADC1 . Or would the ACDC

numbering restart from 0. I am particularly looking at the function below.

void convertAdcChan(uint16_t adcChan) { /* For SW trigger mode, SC1[0] is

used */

ADC0->SC1[0]&=~ADC_SC1_ADCH_MASK; /* Clear prior ADCH bits */

ADC0->SC1[0] = ADC_SC1_ADCH(adcChan); /* Initiate Conversion*/

}

Regards

Saurabh

On Thu, Aug 3, 2017 at 7:44 AM, ovidiualexandru <admin@community.nxp.com>

0 Kudos

916 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

The numbering of ADC channels starts from 0 for each ADC instance. In the case above you would need to either have a new function that uses the ADC1 base address or to send the base address as a parameter to the function.

Regards,

Ovidiu

0 Kudos