Hello everyone,
I'm using S32K344 and S32K3 RTD AUTOSAR 4.4 2.0.1 D2207.
I would like to configure the PWM as OPWMCB (Center aligned Output PWM Buffered) using 6 aligned channels and notification occurring at the beginning of cycle as circled in the image below:
I need to use the driver OCU? How I can configure using the MCUXpresso Config Tools?
I have tried to configure with this way:
I was able to do the Emios_OCU notification to work, but it doesn't look right, this isnt the same channel of PWM and I can't configure with the same.
Thanks.
@MVR A work arround that I've though yesterday and probably that I will use too is:
1. add an extra OPWMCB channel with in the same Master/Counter Bus with duty cycle 99.99%
2. enable the "Flag generation" on the leading edge of the pulse.
3. trigger BCTU with this flag generated from the leading edge of the 99.99% duty cycle pulse
4. and finally BCTU will handle the ADC conversion accordingly to your needs
I hope this helps. If you have thought any other workaround share it let me know.
Kind regards,
kyf
Hello @kyf,
I saw the BCTU options for configuration but I didn't find any option for link with "flag generation" on PWM channel.
It seems to me that BCTU just work with ADC, doesn't it?
For example:
For it, I understand that we must work in "Internal Trigger" section, because the another sections are "Bctu ADC notification" (the name itself says it all, ADC notification), "Bctu LIST items" (if BCTU configured with conversion using list of channels in ADC, we must configure this section) and "Result FIFOs" (If configured the ADC conversion result as FIFO, we must configure this section).
So what was left was the "Internal Triggers", and all options are tied with ADC, like, if is the single conversion or not, the data destination of conversion, and so on...
Did you see my configuration using Emios_OCU? The notification worked in underflow/overflow, but not in the same channel configured on PWM. Maybe this is the way but I think that there is some simple detail disturbing it.
Did you see my configuration using Emios_OCU? The notification worked in underflow/overflow, but not in the same channel configured on PWM. Maybe this is the way but I think that there is some simple detail disturbing it.
I was reading about Ocu today. It is a MCAL driver. You can't trigger other peripherals with Ocu. You can just create interrupt events that CPU will handle. Maybe I'm wrong but from the little time that I've studied it this is what I've understood. In order to initiate an ADC conversion with OCU you have to use the CPU.
By creating a peripheral Event you can use it in order to trigger other Peripherals do stuff without using the CPU.
1. I think that you are right. From BCTU configurations you select the eMIOS chanel that creates the trigger. And you have to set also the eMIOS PWM channel trigger accordingly to your needs from the eMIOS PWM config.
2. Also the TRGMUX connect connect the two signals together (OPWMCB flag generated from leading edge and the BCTU ).
-> Please see the image that I've attached bellow and let me know if this helps.
-> Black background is due to DevStyle addon
I think option 1 is the right solution to this, but it can also be done with option 2. I will try to test them and I'll let you know.
TRGMUX is the "guy" that connects almost everything with everything in those MCUs.
Kind regards,
kyf.
Hello @MVR .
Yes, but prefer to use BCTU instead of a direct trigger to ADC conversion with TRGMUX. Because the BCTU peripheral has many many usefull functions for your needs.
Read chapter 57 of the reference manual and you can see how every "part" is connected in order to set-up a system that will make use of the peripherals.
At the moment I'm trying to configure :
1. OPWMCB with leading edge flag
2. next this flag will be sent to BCTU peripheral
3. BCTU will trigger the ADC conversion according the the list that I've created
4. when ADC conversion is finished BCTU will inform the DMA that data are ready for transfer
5. DMA will transfer data to the desired buffer
Check the block diagram from chapter 57:
Regards,
kyf
Hello Marcus.
I'm working on a similar case past couple weeks. I think that you should connect the trigger signal generated from eMIOS pwm to BCTU periphera via TRIGMUX peripheral. And after that you have to find the correct configuration of BCTU that will trigger the ADC conversion.
I'm working on this as well those days and if I get anywhere near to make it work I'll let you know
Sadly documentation regarding S32 DS IDE Configuration tool is quite poor and the terminology of RefManual does not much with ConfigTool...
Kind regards,
kyf