Multiple ADC channel with SW trigger in 5746R

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

Multiple ADC channel with SW trigger in 5746R

1,583 Views
supra0309
Contributor I

Hi,

 

I'm using 5746R, how can I use multiple ADC channel with SW trigger?

I found there're something about PDB, DMA and CTU, but I can't understand.

Could anyone tell me about these function and setting?

 

Best Regards,

Xantia

0 Kudos
7 Replies

890 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

Just to make sure,

So you want to start ADC conversion by SW on multiple channels, but in the same time?

Furthermore for starting the conversions without SW intervention you can use CTU to offload the core.

what are you trying to achieve? can you share more details on it?

regards,

Peter

0 Kudos

890 Views
supra0309
Contributor I

Hi, 

 

I need to get different inputs simultaneously by using two or more ADC channels. What should I do to finish pinmux setting? Another question is what code/command/header files should I add in main.c to make it work? 

 

Best Regards,

Xantia

0 Kudos

890 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I need to get different inputs simultaneously by using two or more ADC channels

Ok, I suggest you to use BCTU, It is not simple so please first pay attention to reference manual in order to understand how the linking of modules and trigger generation works.

pastedImage_3.png

We have also posted simple examples:

BCTU for GHS,

BCTU  for S32DS

Another question is what code/command/header files should I add in main.c to make it work? 

Are you now talking about driver? You can use MCAL autosar, but It implements only limited CTU functionality.

I am still confused what are you going to do with application. Driving motor? or simple sensing of solenoid or?

How accurate you need the start of measurement to by synchronized...etc

regards,

Peter

0 Kudos

890 Views
supra0309
Contributor I

Hi, 

The example is adc_pal_mpc5746r. I try to modify example program and use different inputs simultaneously (PB0~PB5 shown in figure) into MCU to get resVolts from variable "adc_pal1_Results". But there are some problems about pinsettings, commands and head files. What do they need to be used for program to achieve my goals? Thanks.

Best Regards,

Xantia

pastedImage_1.png

0 Kudos

890 Views
petervlna
NXP TechSupport
NXP TechSupport

Hmm,

I can help you with understanding and configuration of micro.

But you have written some SW or modified some example SW.

I suggest you to contact SDK team via community as I have no knowledge on SDK example codes.

S32 SDK 

If you want to use example codes I have posted, then I can assist.

regards,

Peter

0 Kudos

890 Views
supra0309
Contributor I

Hi,

If you can give me your code, that will help me a lots.

Best Regards,

Xantia

0 Kudos

890 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

Here is the example code of starting multiple channels (0-5) on ADC0 by SW.

I have also configured one port so you can see how to configure the ports you need:

port to pin mapping is in:

https://www.nxp.com/docs/en/user-guide/MPC5746REVB176UG.pdf 

Port to Motherboard Mapping chapter.

You will need to physically connect the PB[x] pins to analog input if they are not.

I do not know which board do you use, so make sure that your analog inputs pins are configured and connected to desired measurement pins/pads,etc...

regards,

Peter

0 Kudos