Unable to make ADC conversion using Eqadc-B ANB16,17,18,19 channels

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

Unable to make ADC conversion using Eqadc-B ANB16,17,18,19 channels

1,093 Views
rahulmankumbare
Contributor II

Hi,

MCU - MPC5777C

IDE- S32DEv1.2

We are using Eqadc-A & Eqadc-B channels for analog to digital conversion.

We are using channels ANA6,ANA34,ANA35,ANA36 etc and able to convert analog data to digital.

Now we are using,

ANB16/GPI484/ETPUC15/EMIOS24

ANB17/GPI485/ETPUC14/EMIOS25

ANB18/GPI486/ETPUC13/EMIOS26

ANB19/GPI487/ETPUC12/EMIOS27 

But Unabble to make conversion.

Following is our init code.

EQADC_B.CFPR[0].R = 0x00800301; // configure ADC_CR0 Register in buffer 0
EQADC_B.CFPR[0].R = 0x82800301; // configure ADC_CR1 Register in buffer 1


EQADC_B.CFCR0.R = 0x1C101C10;
EQADC_B.CFCR1.R = 0x1C101C10;
EQADC_B.CFCR2.R = 0x1C101C10;
// Wait for Queue Done
while (EQADC_B.FISR[0].B.EOQFX == 0) { } /* Wait for End Of Queue flag */

EQADC_B.FISR[0].R = End_of_Queue_Flag;

EQADC_B.IDCR0.R = 0x33033303;
EQADC_B.IDCR1.R = 0x33033303;

SIU.PCR[ANB16_TO_ADC_INV2_TA].R = PRIM_F | K_IBE; //ANB16/GPI484/ETPUC15/EMIOS24

SIU.PCR[ANB17_TO_ADC_INV2_TB].R = PRIM_F | K_IBE; // ANB17/GPI485/ETPUC14/EMIOS25

SIU.PCR[ANB18_TO_ADC_INV2_TD].R = PRIM_F | K_IBE; // ANB18/GPI486/ETPUC13/EMIOS26

SIU.PCR[ANB19_TO_ADC_INV2_TC].R = PRIM_F | K_IBE; //ANB19/GPI487/ETPUC12/EMIOS27

Please suggest missing or incorrect part.

Thanks.

Rahul.

0 Kudos
5 Replies

754 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I have just created example code for this configuration.

It works fine on my side. You can download it here:

https://community.nxp.com/docs/DOC-335394 

Hope it helps

754 Views
rahulmankumbare
Contributor II

Hi,

We have tested the code it is working but we are getting sampling frequency =300KHz.

We want to sample the signal having frequency 50KHz.

The samples that we are getting are not sufficient.

We have set peripheral clock frequency == 96MHz

ADC clock == 24MHz

conversion cycles ==2

So sampling frequency should be 1.5MHz. But practically we are getting 300KHz

We have verified it by giving 50KHz signal input. We are getting 8 samples in 1 cycles of waveform.

PUSH_TO_CFIFO1_B ( B0 |
ADC_REG_VALUE (0x8001) | // enables ADC0 0x8001 == divide by 4 //0x8002 == ADC0/1_CLK_PS divide by 6
ADC_REG_ADDR (ADC0_CR) );

LST == 0 // 0 means 2 cycles for conversion.

How to achieve 1.5 MHz sampling frequency?????

Thanks.

Rahul

0 Kudos

754 Views
rahulmankumbare
Contributor II

Thanks.

We will check & update you.

0 Kudos

754 Views
rahulmankumbare
Contributor II

Hi David,

We are using eDMA.conv cmd.PNGcfifo.PNG
We are able to achieve single scan conversion previously.
Now we are trying with eDMA.
But we are missing some configuration.
Please guide us.
Thanks.
Rahul
0 Kudos

754 Views
rahulmankumbare
Contributor II

Hi David,

We have not been able to read the adc values using DMA yet.

Can you go through the above snaps of our CQueues.

Thanks.

Rahul

0 Kudos