S32K342 ADC module

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K342 ADC module

7,900件の閲覧回数
Venu_M
Contributor III

I have configured ADC0 as interrupt and ADC1 as DMA transfer type at the same time.


For interrupt i can be able to get the converted result in register. But i can't get the value for DMA transfer type.


 What is the reason for I'm not getting result over using DMA.

タグ(1)
0 件の賞賛
返信
18 返答(返信)

7,881件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

What is the reason for I'm not getting result over using DMA.

First you should check if the channel was converted and at the end of the conversion flag is set. (CEOCFRx)

Then configure DMA Request Enable For xxx Inputs (DMARx) for selected channel

petervlna_0-1673267050876.png

 

Once this is done all you need is to have configured DMA and DMAMUX for processing a trigger signal from ADC.

petervlna_1-1673267098935.png

Best regards,

Peter

7,876件の閲覧回数
Venu_M
Contributor III
I have tried with ADC1 as DMA seperately without configuring ADC0.
But i have modified the main.c file like DMA function first work and interrupt function will process next.

So the first function is working whether it is DMA or Interrupt.
second function is not converting.

What should i do?
0 件の賞賛
返信

7,861件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

If you have correctly configured DMARx register for ADC1 then there is no interaction with any interrupts.

Your ADC->DMA will skip core intervention and dirrectly copy data from ADC to destination address set in DMA.

Those are 2 separated processes and will not interfere.

There must be some issue in the functions and how they handle resources. From HW point of view I see no issue performing this operation.

I suggest you you to closer debug your functions to see where it get stuck.

Best regards,

Peter

0 件の賞賛
返信

7,850件の閲覧回数
Venu_M
Contributor III

Can i use both instance as interrupt ADC0 and ADC1?
For that what i want to do? Its possible to connect on teams we both for this configuration?

If i configured ADC0 as Interrupt and ADC1 as DMA ,  after completing the ADC0 the bstatus is moved from true to false condition.So the second instance cant able to run.

0 件の賞賛
返信

7,836件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Can i use both instance as interrupt ADC0 and ADC1?

Sure, just mind the priorities, or read both ADCs in same interrupt. This all is application specific.


For that what i want to do? Its possible to connect on teams we both for this configuration?

Not directly, if you want direct NXP support, please get in touch with NXP FAE / sales or distributor. They are able to setup meetings.

If i configured ADC0 as Interrupt and ADC1 as DMA , after completing the ADC0 the bstatus is moved from true to false condition.So the second instance cant able to run.

How do you start ADC1?

It should be simple. Just configure ADC1 and write NCR [ NSTART] bit. You can do it from debugger to check if its converting data. Please follow reference manual in order to setup and start conversion of ADC1.

59.3.4 Normal trigger

petervlna_0-1673520382121.png

Best regards,

Peter

 

0 件の賞賛
返信

7,806件の閲覧回数
Venu_M
Contributor III

I have configured ADC0 and ADC1 as interrupt transfer method.
In platform i have selected interrupt IRQ for both ADC0 and ADC1.
Next what i have to do in configuration and code part.

 

I got result in register, how to check whether it is using interrupt transfer method is working.

MCR,MSR,ISR,CEOCFRn,NCMRn,PCDRn,ICDRn,IMR register also updating. Apart from this which register need to update.

Can you tell me by using Adc_example_S32K342. what i have to do for both ADC0 and ADC1.

It's very much necessary for me please give me a detailed solution on this.

タグ(2)
0 件の賞賛
返信

7,788件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I got result in register, how to check whether it is using interrupt transfer method is working.

Ok, simply set breakpoint on your ISR function where you read the results. If the function is called and there is correct result you can assume that it is working.

Can you tell me by using Adc_example_S32K342. what i have to do for both ADC0 and ADC1.

It's very much necessary for me please give me a detailed solution on this.

Unfortunately I do not have any Adc_example_S32K342. Is this a part of some NXP SW package?

Furthermore if you need application support please contact NXP FAE/sales assigned to your company or distributor, they are able to set up application support channel.

Best regards,

Peter

0 件の賞賛
返信

7,785件の閲覧回数
Venu_M
Contributor III
MCR,MSR,ISR,CEOCFRn,NCMRn,PCDRn,ICDRn,IMR register also updating. Apart from this which register need to update.
0 件の賞賛
返信

7,781件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am a bit confused here.

Could you closer specify the question?

Best regards,

Peter

0 件の賞賛
返信

7,778件の閲覧回数
Venu_M
Contributor III

Actually its converting and updating in the particular register.
If I'm using interrupt type which register need to update(ISR and IMR) or any other register.

 

0 件の賞賛
返信

7,720件の閲覧回数
Venu_M
Contributor III

Its working fine ADC0 and ADC1.But for ADC0 - Precision channel 6 and ADC1 - Standard channel 23 

I can't get the value in the register. But its updating the value randomly if I change the input value also its not getting correct value in the register.
I have checked in the configuration and voltage level in the particular pin also.
I have configured like a group in that group except these two channels remaining channels are converting.
For this what i have to check and do?

タグ(1)
0 件の賞賛
返信

7,635件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

How do you trigger the conversions?

Do you have them synchronized from some timer, so you will prevent asynchronous triggering?

From what you express, it looks like there is no fix timing for your conversions, hence the interrupts will be executed in random order.

Correct me if I am wrong please

Best regards,

Peter

0 件の賞賛
返信

7,630件の閲覧回数
Venu_M
Contributor III
After conversion done the interrupt will set the flag on ISR and IMR register.
0 件の賞賛
返信

7,564件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I see you have 2 ADC interlaces with 2 interrupts.

How do you secure that these 2 interrupts will not interfere?

Do you have one timer which synchronize the conversions and reads?

Best regards,

Peter

0 件の賞賛
返信

7,558件の閲覧回数
Venu_M
Contributor III
Hello @petervlna

Do you have one timer which synchronize the conversions and reads?

For interrupt, I configured Interrupt handler and interrupt request.


0 件の賞賛
返信

7,550件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Ok, I will try to explain it one more time.

1. You have 1 interrupt processing unit

2. you have 2 ADC modules which triggers 2 interrupts in unknown time.

Those 2 interrupts will interfere when triggered at same time (as only 1 is processed) and therefore you will see inconsistent data in your result registers.

So my questions is how do you time ADC conversions to prevent this situation to happen?

Best regards,

Peter

0 件の賞賛
返信

7,511件の閲覧回数
Venu_M
Contributor III

1. You have 1 interrupt processing unit?

I have configured 2 interrupt Api for ADC0 and ADC1.

ISR(Adc_Sar_0_Isr) and ISR(Adc_Sar_1_Isr).

So how it will interfere with each other?

0 件の賞賛
返信

7,461件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

You realize that API is SW functions and you can have infinite number of whatever in it,

but HW is only 1?

Your limitation is always HW.

Best regards,

Peter

0 件の賞賛
返信