ADC with MPC5748G

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,499件の閲覧回数
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 件の賞賛
1 解決策
1,431件の閲覧回数
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 件の賞賛
6 返答(返信)
954件の閲覧回数
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 件の賞賛
1,494件の閲覧回数
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,482件の閲覧回数
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 件の賞賛
1,468件の閲覧回数
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,455件の閲覧回数
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 件の賞賛
1,432件の閲覧回数
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 件の賞賛