eMIOS ADC conversion with BCTU triggers

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

eMIOS ADC conversion with BCTU triggers

Jump to solution
2,436 Views
FelixR
Contributor III

Hello there,

I'm trying to understand the ADC and eMIOS hardwaretrigger synergy inside the S32K324 better and I do have some questions about its functionality.

So the eMIOS Channel creates its PWM signal inside the OPWMT mode, settings it's output on a match on A and releasing it on a B match. Now the A2 register does generate a trigger on 50% of my output cycle which is send to the BCTU to trigger an ADC channel. So far so good. 

Let's assume that I have 3 (or more) BCTU Trigger configurations on ADC Channels running in One-Shot mode with pre-sampling on the same ADC instance. The ADC is also in BCTU control mode, ensuring that only the BCTU can send a trigger. What does happen to my ADC triggers if they come up simultaneously? The reference manual states this scenario for two ADC triggers but I am unsure about 3 or more simultaneous triggers.

And the next question would be how the triggers stack on each other. If a trigger is delayed until the ADC is ready again, when is this? 
A normal ADC trigger cycle is pre-sample -> sample -> conversion. But does the delayed BCTU trigger count as an injected trigger and it's similar to figure 250. on the RM or does each channe completes it's conversion before the next bctu trigger is executed?

My last question is how I would verify my trigger timing? If I wan't to toggle a PIN when my ADC conversion starts? Is there a IRQ which the processor can access when the A2 trigger is set or when the BCTU starts a conversion?

0 Kudos
Reply
1 Solution
2,418 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@FelixR

1.There shoud no difference between two triggers or three triggers at the same time.

The rule is same :

"The lowest number, trigger 0, has the highest priority, and the highest number, trigger 71, has the lowest priority."

 

2.Priority among 3 Conversion Types

−If a BCTU conversion is requested during Injected mode, the Injected chain will be aborted immediately and only the BCTU triggered Injected conversion mode is processed.

−If a BCTU conversion is requested during Normal mode, the Normal chain will be suspended and the BCTU triggered Injected conversion mode is processed.

−If a Normal conversion is requested during BCTU mode, the Normal chain will start after the BCTU conversion is completed

−If an Injected conversion is requested during BCTU mode, the Injected chain will be discarded immediately.

 

3.

a. For example, if you are using Ch1, OPWMT mode of eMios0, you can set the phase shift and Trigger to be the same, and observe the output waveform. The trigger point and the output edge should be consistent.

 

Capture.JPG


b. You can also use the TRGF bit of the MSR register of BCTU

Capture.JPG

 

 

View solution in original post

0 Kudos
Reply
1 Reply
2,419 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@FelixR

1.There shoud no difference between two triggers or three triggers at the same time.

The rule is same :

"The lowest number, trigger 0, has the highest priority, and the highest number, trigger 71, has the lowest priority."

 

2.Priority among 3 Conversion Types

−If a BCTU conversion is requested during Injected mode, the Injected chain will be aborted immediately and only the BCTU triggered Injected conversion mode is processed.

−If a BCTU conversion is requested during Normal mode, the Normal chain will be suspended and the BCTU triggered Injected conversion mode is processed.

−If a Normal conversion is requested during BCTU mode, the Normal chain will start after the BCTU conversion is completed

−If an Injected conversion is requested during BCTU mode, the Injected chain will be discarded immediately.

 

3.

a. For example, if you are using Ch1, OPWMT mode of eMios0, you can set the phase shift and Trigger to be the same, and observe the output waveform. The trigger point and the output edge should be consistent.

 

Capture.JPG


b. You can also use the TRGF bit of the MSR register of BCTU

Capture.JPG

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2049491%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EeMIOS%20ADC%20conversion%20with%20BCTU%20triggers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2049491%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20there%2C%3C%2FP%3E%3CP%3EI'm%20trying%20to%20understand%20the%20ADC%20and%20eMIOS%20hardwaretrigger%20synergy%20inside%20the%20S32K324%20better%20and%20I%20do%20have%20some%20questions%20about%20its%20functionality.%3C%2FP%3E%3CP%3ESo%20the%20eMIOS%20Channel%20creates%20its%20PWM%20signal%20inside%20the%20OPWMT%20mode%2C%20settings%20it's%20output%20on%20a%20match%20on%20A%20and%20releasing%20it%20on%20a%20B%20match.%20Now%20the%20A2%20register%20does%20generate%20a%20trigger%20on%2050%25%20of%20my%20output%20cycle%20which%20is%20send%20to%20the%20BCTU%20to%20trigger%20an%20ADC%20channel.%20So%20far%20so%20good.%26nbsp%3B%3C%2FP%3E%3CP%3ELet's%20assume%20that%20I%20have%203%20(or%20more)%20BCTU%20Trigger%20configurations%20on%20ADC%20Channels%20running%20in%20One-Shot%20mode%20with%20pre-sampling%20on%20the%20same%20ADC%20instance.%20The%20ADC%20is%20also%20in%20BCTU%20control%20mode%2C%20ensuring%20that%20only%20the%20BCTU%20can%20send%20a%20trigger.%20What%20does%20happen%20to%20my%20ADC%20triggers%20if%20they%20come%20up%20simultaneously%3F%20The%20reference%20manual%20states%20this%20scenario%20for%20two%20ADC%20triggers%20but%20I%20am%20unsure%20about%203%20or%20more%20simultaneous%20triggers.%3C%2FP%3E%3CP%3EAnd%20the%20next%20question%20would%20be%20how%20the%20triggers%20stack%20on%20each%20other.%20If%20a%20trigger%20is%20delayed%20until%20the%20ADC%20is%20ready%20again%2C%20when%20is%20this%3F%26nbsp%3B%3CBR%20%2F%3EA%20normal%20ADC%20trigger%20cycle%20is%20pre-sample%20-%26gt%3B%20sample%20-%26gt%3B%20conversion.%20But%20does%20the%20delayed%20BCTU%20trigger%20count%20as%20an%20injected%20trigger%20and%20it's%20similar%20to%20figure%20250.%20on%20the%20RM%20or%20does%20each%20channe%20completes%20it's%20conversion%20before%20the%20next%20bctu%20trigger%20is%20executed%3F%3C%2FP%3E%3CP%3EMy%20last%20question%20is%20how%20I%20would%20verify%20my%20trigger%20timing%3F%20If%20I%20wan't%20to%20toggle%20a%20PIN%20when%20my%20ADC%20conversion%20starts%3F%20Is%20there%20a%20IRQ%20which%20the%20processor%20can%20access%20when%20the%20A2%20trigger%20is%20set%20or%20when%20the%20BCTU%20starts%20a%20conversion%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2049699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20eMIOS%20ADC%20conversion%20with%20BCTU%20triggers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2049699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EFelixR%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E1.There%20shoud%20no%20difference%20between%20two%20triggers%20or%20three%20triggers%20at%20the%20same%20time.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20rule%20is%20same%20%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%22The%20lowest%20number%2C%20trigger%200%2C%20has%20the%20highest%20priority%2C%20and%20the%20highest%20number%2C%20trigger%2071%2C%20has%20the%20lowest%20priority.%22%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E2.Priority%20among%203%20Conversion%20Types%3C%2FP%3E%0A%3CP%3E%E2%88%92If%20a%20BCTU%20conversion%20is%20requested%20during%20Injected%20mode%2C%20the%20Injected%20chain%20will%20be%20aborted%20immediately%20and%20only%20the%20BCTU%20triggered%20Injected%20conversion%20mode%20is%20processed.%3C%2FP%3E%0A%3CP%3E%E2%88%92If%20a%20BCTU%20conversion%20is%20requested%20during%20Normal%20mode%2C%20the%20Normal%20chain%20will%20be%20suspended%20and%20the%20BCTU%20triggered%20Injected%20conversion%20mode%20is%20processed.%3C%2FP%3E%0A%3CP%3E%E2%88%92If%20a%20Normal%20conversion%20is%20requested%20during%20BCTU%20mode%2C%20the%20Normal%20chain%20will%20start%20after%20the%20BCTU%20conversion%20is%20completed%3C%2FP%3E%0A%3CP%3E%E2%88%92If%20an%20Injected%20conversion%20is%20requested%20during%20BCTU%20mode%2C%20the%20Injected%20chain%20will%20be%20discarded%20immediately.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E3.%3C%2FP%3E%0A%3CP%3Ea.%20For%20example%2C%20if%20you%20are%20using%20Ch1%2C%20OPWMT%20mode%20of%20eMios0%2C%20you%20can%20set%20the%20phase%20shift%20and%20Trigger%20to%20be%20the%20same%2C%20and%20observe%20the%20output%20waveform.%20The%20trigger%20point%20and%20the%20output%20edge%20should%20be%20consistent.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorSenlent_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20855px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20855px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325306i64A5AFC62302C6D2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.JPG%22%20alt%3D%22Capture.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3Eb.%20You%20can%20also%20use%20the%20TRGF%20bit%20of%20the%20MSR%20register%20of%20BCTU%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325307i0242BABCA42361E1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.JPG%22%20alt%3D%22Capture.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E