ADC with MPC5748G

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

ADC with MPC5748G

Jump to solution
1,600 Views
Elsa_24
Contributor II
Hi, I would like to know how to read for example the voltage across a pin using the ADC. I have already activated the PI[11] pin corresponding to Standard Channel 19 of the ADC0 and I would like to read the voltage across this pin. And the ADC component has already been added to the project Thanks
0 Kudos
Reply
1 Solution
1,532 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

see Table 32-4. ADC channel mapping of the RM.

ADC1_P[0] is mapped to the channel 9 of the ADC1

PetrS_0-1616660993164.png

 

BR, Petr

View solution in original post

0 Kudos
Reply
6 Replies
1,055 Views
SAchary11
Contributor I

Hello Elsa,

I am also trying to measure the supply voltage or battery voltage in MPC5748G using ADC,

Can you please help me out how did you configure the ADC and also the propcedure you followed?

0 Kudos
Reply
1,595 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if using the SDK you can refer to e.g. "adc_swtrigger_mpc5748g" demo example to know how ADC driver can be used.

BR, Petr

1,583 Views
Elsa_24
Contributor II

Hi PetrS,

Thanks for your Answer.

As you advised, I tried to understand the example "adc_swtrigger_mpc5748g"

As a small modification, I tried to display with the UART the value of the result on the Terminal. but I can't do it. I've been trying to figure out how to do this.

 

Here is the part of the code that I modified:
I just added the "LINFLEXD_UART_DRV_SendData" But it doesn't show me anything on the Terminal

if (result > ADC_THRESHOLD)
{

PINS_DRV_ClearPins(LED_PORT, (1 << LED));


LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, result, 1u);


}
else
{

PINS_DRV_SetPins(LED_PORT, (1 << LED));


LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, result, 1u);
}

 

Thanks

0 Kudos
Reply
1,569 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the "result" is integer variable and LINFLEXD_UART_DRV_SendData expect char/string to send it through LINFlexD. You need to convert "result" to string.

BR, Petr

1,556 Views
Elsa_24
Contributor II

 

Hi PerS,

Another Question Please

Why, in the example, is number 9 assigned as the ADC_Channel_Number when PB[4] corresponds to precision channel 0 in the ADC1?

 

 #define ADC_CHAN_NUM (9u) /* ADC1_P[0] corresponding to PB[4] */

Thanks

0 Kudos
Reply
1,533 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

see Table 32-4. ADC channel mapping of the RM.

ADC1_P[0] is mapped to the channel 9 of the ADC1

PetrS_0-1616660993164.png

 

BR, Petr

0 Kudos
Reply