Using ADC0_SE4a/ADC0_SE5a/ADC0_SE6a on MK02FN64 with fsl_adc16

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

Using ADC0_SE4a/ADC0_SE5a/ADC0_SE6a on MK02FN64 with fsl_adc16

1,374 Views
carstenkühn
Contributor I

Hello,

 

i'm trying to use the ADC channels  ADC0_SE4a, ADC0_SE5a and ADC0_SE6a on a MK02FN64LH10 with the fsl_adc16 driver from SDK1.2.

But when I setup a channel configuration with one of these ADC pins in Processor Expert I get following Error:

 

The routing parameters are not specified correctly, there are several peripherals matching the 'alias' query. (A/D channel (pin))

 

Is there a bug in processor expert?

 

Regards,

Carsten

Labels (1)
Tags (3)
0 Kudos
5 Replies

704 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Carsten,

This know issue of Processor Expert. When one pin can be used as two different ADC channels in the single ended mode the fsl_adc component cannot select the channel number according to the pin (the same pin is used for two channels and there is not any other property that allows selection of the channel number). The issue will be fixed in the next release.

There is possible to use the following workaround for this issue:

The A/D Channel (pin) property is used for selection of the channel and also for the allocation of the pin (routing of the pin). When a channel cannot be selected (e.g. the ADC0_SE4a) you can select an internal signal (e.g. VDDA; the internal signal does not allocate any pin) as a placeholder for the configuration item in the adc16_chn_config_t structure that is generated in the source code file, see below:

83319_83319.pngpastedImage_3.png

The required pin can be selected in the PinSettings, i.e. open the ADC tab in the PinSettings and select the pin of the ADC for allocation and for routing of this pin, see below:

83318_83318.pngpastedImage_2.png

Generate code of the project and freeze the generated code for the fsl_adc component, i.e. in the context menu of the fsl_adc component select the Code Generation > Don't Write Generated Component  Modules, see below:

83320_83320.pngpastedImage_4.png

The generated source code files will not be modified during generating code by the Processor Expert. You can modify the configuration structure and correct the channel number in the initialization code of the configuration structure (e.g. replace kAdc16Chn29 by kAdc16Chn4a in the adConv1 source code file), see below:

const adc16_chn_config_t adConv1_ChnConfig1 = {

  .chnIdx = kAdc16Chn4a,

  .convCompletedIntEnable = false,

  .diffConvEnable = false

};

This modification of the project allows you to use all channels of the ADC and properly allocate (route) required pins.

Best Regards,

Marek Neuzil

0 Kudos

704 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Carsten,

From the Reference manual of K02,  the ADC input signal  of "ADC0_SE4a" and "ADC0_SE4a" use the same pin PTE16,

and in the PE ,we can see the "A/D channel(pin)" selection is pin , so i think this button only can identify which pin ,while this

pin has TWO ADC channel , so it show error . When we select the channel as "ADC0_SE4b" or others , it will no error.

And if you want use "ADC0_SE4a" , i recommend you configure it us code , please refer to the demo code under SDK installation directory:

KSDK_1.2.0\examples\frdmk22f\driver_examples\adc16 :

in the demo code , you can see the configuration  of the  channel as this :

pastedImage_3.png

pastedImage_4.png

pastedImage_5.png

For example , if you want use che ADC0_SE4a , you can change it to :

#define ADC16_TEMPERATURE_CHN   (kAdc16Chn4 )

And please pay attention to this : in the PE configure window , when the selection show this symbol of red , it meaning it can not select :

pastedImage_0.png

Hope it helps

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------


Have a great day,

Alice

0 Kudos

704 Views
carstenkühn
Contributor I

Hello Alice,

Thanks for the fast answer. I allready suposed that using the mentioned adc chanels by code is possible. I will try.

But, if they are usable by coding, do you know why they aren't usable by PE?

Greetings,

Carsten

0 Kudos

704 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Carsten,

I just got the reply from PE team, then confirm this is a bug , and will fix on the next PE version.

Now , if need use these channels ,, i think can  write code by hand refer to i said before.

Sorry for the inconvenient to you !

BR

Alice

0 Kudos

704 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Carsten,

Sorry i also don't know , i will ask the PE expert , then i will tell you .ASAP.

BR

Alice

0 Kudos