S32K3 - RTD - eMIOS DAOC Configuration / Usage

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

S32K3 - RTD - eMIOS DAOC Configuration / Usage

Jump to solution
708 Views
grol
Contributor I

Hi,

I am trying to find a way to configure a eMIOS DAOC output pin to output a pulse at specific timer values - as in the example in the eMIOS section of the reference manual.

The RTD interface only allows DAOC with the PWM interface, so the only plausible function to set the timing is Pwm_SetPeriodAndDuty. But this always sets A to 1, while I would like to base the start of the event on a timestamp captured via the Icu.

The PWM code also generates a useless interrupt...

Is there a way to do that with the current RTD or is this something that I would need to write by hand?

Thanks!

G

0 Kudos
Reply
1 Solution
617 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@grol

1. No such API is provided

I looked at our driver, in DAOC mode it will only update the value of reg B, and the default reg A is set to 1

2. Your understanding is correct, but this does not affect anything. It should be possible to pause the counter count in the DAOC interrupt handler

 

View solution in original post

0 Kudos
Reply
8 Replies
665 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@grol

I don't quite understand your question, do you want us to provide you with a DAOC routine or something?

0 Kudos
Reply
659 Views
grol
Contributor I

Hi @Senlent ,

thanks for your response - yes, I basically would like to have a fast interface to set up a DAOC event.

So far I have figured out that DAOC is represented in RTD in the Pwm module, but I could not find an Pwm_* interface to set up a single pulse at a specific time.

I have eMIOS channel 23 set up as my counter and would like to use DAOC to output a pulse (using CH14 at the moment) starting at A and ending at B - with A and B being arbitrary "timestamps" of my CH23 counter.

Then trigger an interrupt at B (falling edge).

My question was basically if this is something supported by the RTD and if yes, what is the function to use?

Thanks a lot!

grol

0 Kudos
Reply
631 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@grol

Senlent_0-1724662966530.png

 

0 Kudos
Reply
624 Views
grol
Contributor I

Maybe my misunderstanding is based on the fact that I don't actually want a PWM output but just a single fire event

0 Kudos
Reply
637 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@grol

The attachment is the eMIOS DAOC routine based on RTD 2.0.3, you can refer to it

0 Kudos
Reply
626 Views
grol
Contributor I

Hi @Senlent ,

thanks for the demo project.

Unfortunately this does only cover the RTD configuration itself, not any interfacing to change timing parameters during runtime.

I am testing a function like this now - which I added as a new function in Emios_Pwm_Ip.c:

Emios_Pwm_Ip_StatusType Emios_Pwm_Ip_SetDaocAB(uint8  Instance,
    uint8  Channel,
    Emios_Pwm_Ip_PeriodType A,
    Emios_Pwm_Ip_PeriodType B)
{
[...]
  /* Configure Leading Edge in reg A */
  Emios_Pwm_Ip_SetUCRegA(Base, Channel, A);

  /* Configure Trailing Edge in reg B */
  Emios_Pwm_Ip_SetUCRegB(Base, Channel, B);

  /* Push A/B */
  Emios_Pwm_Ip_SetOutputUpdate(Base, Channel, TRUE);
[...]
}

This is what I was searching for, am I right that nothing like this exists?

I also don't really understand why the function Emios_Pwm_Ip_IrqDaocHandler always re-enables the DAOC, so I end up with a blinking LED in the example - my understanding was that DAOC is supposed to be a one-time event.

Thanks!

Best regards,

grol

0 Kudos
Reply
618 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@grol

1. No such API is provided

I looked at our driver, in DAOC mode it will only update the value of reg B, and the default reg A is set to 1

2. Your understanding is correct, but this does not affect anything. It should be possible to pause the counter count in the DAOC interrupt handler

 

0 Kudos
Reply
614 Views
grol
Contributor I

Hi @Senlent ,

Thanks for the clarification!

I will use a custom implementation similar to the one shown above to create a pulse for my use case then.

Best regards,

grol

0 Kudos
Reply