Is it possible to delay ADC convert starting with BCTU trigger source?

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

Is it possible to delay ADC convert starting with BCTU trigger source?

2,333 Views
michael_chien1
Contributor II

I'm working for triggering ADC convert by BCTU in AUTOSAR base, MCAL 4.3.
My purpose is to capture high amplitude voltage value of PWM waveform.
but I have a question:
1. is it possible to delay ADC convert starting with BCTU trigger source because there is a gap between trigger source and PWM waveform in our hardware.
2. what is the purpose of "hardware trig timer"?

attachment is my ADC module setting from AUTOSAR.

0 Kudos
12 Replies

2,236 Views
michael_chien1
Contributor II

I use ICU module to capture the duty value with EMIOUS 0 channel 14 and I attach it.

 

another question. Do you know if the channel sequence in red bock is able to change the ADC convert sequence?

if not, where I can set to change ADC convert sequence?

the reason I ask is I would like to change the ADC convert sequence to make it trigger in the greenbox.

Do you think if this works?

michael_chien1_0-1618559976577.png

 

0 Kudos

2,197 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 ,

I have checked the configuration you send and I see that:

- In the Icu 's configuration the IcueMiosMasterBus is not configured. So I wonder how you can generate the configuration.

hungnguyenphi_0-1618821772004.png

 

Regarding your question:

Do you know if the channel sequence in red bock is able to change the ADC convert sequence?

[Hung] The red block is just an order of channels each time ADC group 's conversion is triggered.

if not, where I can set to change ADC convert sequence?

[Hung] With your configuration, the ADC convert sequence is setup as a period of the input signal of EMIOS channel 14.

hungnguyenphi_4-1618824098067.png

The ADC conversion will be started/triggered base on the FLAG bit in the  eMIOS_Sn of channel (with your configuration it will trigger on rising edge of the FLAG bit).

So with your configuration the ADC will trigger at the Yellow slash in the below picture(Zoom in of blue box in previous picture).

hungnguyenphi_1-1618823512843.png

Best regards,

Hung

 

0 Kudos

2,306 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 

I would like to answer your question:

1. is it possible to delay ADC convert starting with BCTU trigger source because there is a gap between trigger source and PWM waveform in our hardware.

[Hung] Could you please try the "ADC Mux Delay (0 -> 65535)".

hungnguyenphi_1-1618215042473.png

 

hungnguyenphi_0-1618215005932.png

 


2. what is the purpose of "hardware trig timer"?

[Hung] Could you please explain more. I cannot find the "hardware trig timer" in the ADC. The Timer can be used to trigger the ADC conversion(if user want to trigger the ADC conversion as period). 

 

Thank and best regards,

Hung

2,292 Views
michael_chien1
Contributor II

Hello Hung
thanks for your reply
1. I try this, but it's not work for my issue.
let me have more description for my issue and see if you have better idea.
red block the my problem.
blue signal is my trigger source for BCTU and yellow signal is the for ADC convert.
I need to get the max voltage value of yellow signal, so red block will make me get incorrect voltage value from BCTU trigger ADC.
As my understand, BCTU is level triggered, so it means I will get incorrect voltage value with BCTU trigger in red block sometime, right?
do you have any idea to avoid this issue? for example, make BCTU don't trigger so many times in one plus, or don't trigger ADC convert in red block?

michael_chien1_0-1618313047660.png


2. this is an AUTOSAR configuration setting item. I also have no idea for this item and that is why I asked. Here is the description in configuration, "Reload value of the ADC module embedded timer. This parameter is not used by the current implementation". I'm not sure if this is helpful for my issue.

 

0 Kudos

2,276 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 ,

1. From my understand, if you want to get the max voltage value of yellow signal, the BCTU should trigger in the greenbox. If you trigger the ADC conversion in the falling edge of the blue signal, then the adc converted value will be minimum value(or may be lower value if the ADC convert in the edge of the yellow signal. The converted result will depend on the sample time and the point application trigger the conversion).

Because you just share  ADC configuration then I do not know how you trigger the ADC conversion with EMIOS via BCTU.

hungnguyenphi_0-1618381643391.png

2.  Because this parameter is not used by the current implementation", so this does not  help for your issue.

Best regards,

Hung

0 Kudos

2,265 Views
michael_chien1
Contributor II

Because you just share ADC configuration then I do not know how you trigger the ADC conversion with EMIOS via BCTU.
to my understanding, BCTU is triggering as long as high of source, blue waveform, right?

I attach MCU module for your reference. Which module do you need further?

Is there any way to make BCTU trigger one time in the greenbox?

0 Kudos

2,246 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 ,

 

BCTU is triggering as long as high of source, blue waveform, right?

[Hung] As far as I know, the input trigger of the BCTU is event(interrupt FLAG) of EMIOS or LPIT. I would like to ask:

- Where/how you got the blue waveform. And how you setup the high level of blue waveform as the input of the BCTU.

- As I can see in your ADC configuration, the trigger source for your BCTU is EMIOS0_14. So the FLAG of EMIOS0 channel 14 will be used to trigger the ADC group conversion.

- Could you please also share the GPT, ICU, OCU, PWM configuration. The module can enable/setup the EMIOS.

 

Thank and best regards,

Hung.

0 Kudos

2,165 Views
michael_chien1
Contributor II

Hello Mr.Hung

     I do a test. it's edge triggered as your mention.

     But why it's pushed out somehow? I though the triggering time should be the same.

 

yellow: trigger source

Blue: ADC convert complete

michael_chien1_0-1619175291717.png

 

0 Kudos

2,114 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 ,

 

The "ADC convert complete" is not the point that the ADC is triggered(The peripheral will set the completed flag when the conversion completed). And the "ADC convert complete" handler may be called latter if at the point of time the interrupt is trigger, some other higher priority interrupt is servicing. So I think that the waveform which you have is normal. Anyway, from my point of view, it will not affect the converted result.

 

Best regards,

Hung

0 Kudos

2,097 Views
michael_chien1
Contributor II

Hello Hung

       Thanks for your reply. However, ADC get the wrong value (low level voltage value). 

      is it possible to change ADC channel convert sequence to make specific ADC channel is executed earlier?

      

     channel 4, Pin081_Pilot_AMP_SENSE_AIP is the ADC channel which I would like to get correct voltage value.

    I attach the my ADC module for your reference.

michael_chien1_0-1619418268302.png

 

0 Kudos

2,087 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @michael_chien1 

 is it possible to change ADC channel convert sequence to make specific ADC channel is executed earlier?

[Hung] Yes, please move the "/Adc/Adc/AdcConfigSet/AdcHwUnit/Pin081_PILOT_AMP_SENSE_AIP" to the first index

hungnguyenphi_1-1619426475969.png

 

Best regards,

Hung.

 

0 Kudos

2,226 Views
michael_chien1
Contributor II

I use ICU module to capture the duty value with EMIOUS 0 channel 14 and I attach it.

 

another question. Do you know if the channel sequence in red bock is able to change the ADC convert sequence?

if not, where I can set to change ADC convert sequence?

the reason I ask is I would like to change the ADC convert sequence to make it trigger in the greenbox.

Do you think if this works?

michael_chien1_0-1618564267901.png

 

0 Kudos