ADC_LDD for Kinetis K20

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

ADC_LDD for Kinetis K20

Jump to solution
2,471 Views
Vagni
Contributor IV

I am cloning the bsp_twrk60n512_pe to a new one for my new board based on the Kinetis K20 with LQFP 100-pin package.

I am using CodeWarrior 10.1 SE with ProcessorExpert 5.1 and MQX 3.7.

I have two issues regarding to the ADC_LDD component.

 

I added one ADC_LDD for ADC0 and one for ADC1. On ADC0 I defined a list of 13 A/D channels; on ADC1 I defined a list of 11 A/D channels.

 

On ADC0 the channel list appears OK, but I cannot define sample groups for some of the defined channels (see the first attachment), because the ProcessorExpert tool reports those channels are not defined :smileyalert:. Why?

 

On ADC1 some pins report the error "Pins with shared control must be set identically" (see the second attachment). What does it mean?

 

Can yoy please help me to fix those issues?

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,563 Views
ProcessorExpert
Senior Contributor III

Hello,

 

I have reproduced the problem. The bug comes if the list of channels contains 10 and more items. It has been already fixed for PE5.3 (MCU10.2). Since there is no workaround please use the attached hot-fix for PE V5.1. The instructions are in the readme.txt inside the archive.

 

I have also noticed (after aplying the hot-fix) that there apper error by multiple pins in ADC1. I have resolved it by changing value of the last pin.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

View solution in original post

0 Kudos
5 Replies
1,564 Views
ProcessorExpert
Senior Contributor III

Hello,

 

Regarding "Sample Group" issue 1):

I was not able to reproduce it. Could you please post here the ProcessorExpert.pe file from your project? Please close the project before passing it here.

 

Regarding "Pins with shared control must be set identically", issue 2):
a)
Could you please provide the ProcessorExpert.pe file from you project or the complete list of pins selected in ADC0 and ADC1 components in order to reporduce your problem? The provided list of pins of your PinSharedControl.JPG is not complete.
b)
We are aware that this message is not user friendly and we plan to publish it improvements in Q1-Q2 2012. Its caused by routing (muxing) conflict.

As I wrote before you didnt provide the complete list, but could you please verify that you have selected "a" channel on all pins in ADC1 (for details see attachment)?

 

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos
1,564 Views
Vagni
Contributor IV

Dear Filip,

 

After may last project saving, it looks like the issue 2) be disappeared :smileyalert:. But the issue 1) is still present on both the ADC_LDD embedded components I use.

See my attached ProcessorExpert.pe file.

Thank you.

 

Best Regards

Alessandro

0 Kudos
1,564 Views
ProcessorExpert
Senior Contributor III

Hello,

 

I have reproduced the problem. The bug comes if the list of channels contains 10 and more items. It has been already fixed for PE5.3 (MCU10.2). Since there is no workaround please use the attached hot-fix for PE V5.1. The instructions are in the readme.txt inside the archive.

 

I have also noticed (after aplying the hot-fix) that there apper error by multiple pins in ADC1. I have resolved it by changing value of the last pin.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

0 Kudos
1,564 Views
Vagni
Contributor IV

Thank you, Filip. The hot-fix fixes the first issue.

But I still get the error "Pins with shared control must be set identically" on some input pins for ADC1. I think it is the same error you saw and you resolved by changing the value of the last pin.

 

I think this issue is due to the fact that in my board with Kinetis K20 cpu I have the following analog input channel to measure:

  • ADC1_SE4a (pin 1, PTE0)
  • ADC1_SE5a (pin 2, PTE1)
  • ADC1_SE6a (pin 3, PTE2)
  • ADC1_SE7a (pin 4, PTE3)
  • ADC1_SE4b (pin 80, PTC8)

As you have seen, if I change the last analog input channel to another available one (e.g. TempSensor), the error disappears.

So I think my issue is due to the K20 analog input MUX for the ADCx_SEn analog input channel.

 

Is ADC_LDD embedded component able to control the K20 analog input MUX too ?

If yes, how?

If not, should I control the K20 analog input MUX run-time in my application, driving the MUXSEL bit of the K20 ADC1_CFG2 register, when I have to measure those analog input channels ? (e.g., to read ADC1_SE4b I suppose to select ADC1_SE4a on ADC_LDD, set the MUXSEL bit, then trigger the A/D conversion)

 

Best Regards

Alessandro

 

0 Kudos
1,564 Views
ProcessorExpert
Senior Contributor III

Hello,

 

I think you have to control the muxing in run-time as for example below:

 

/* ADC1_CFG2: MUXSEL=1 */
ADC1_CFG2 |= (uint32_t)0x10UL;

 

/* PORTC_PCR8: ISF=0,MUX=0 */

PORTC_PCR8 &= (uint32_t)~0x01000700UL;

 

AD1_SelectSampleGroup(...,10);

 

In channel 10 select a e.g. TempSensor.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

0 Kudos