Emx + rlp: pwm

Hello,
because Uitity.Piezo() stopped working since .NETMF 4.3, I’ve connected our piezo to IO49 PWM3 output. I’m trying to simulate previous behavior so when the user press the button on the touch screen, we need to make beep (1000 Hz for 50ms). I’ve tried to use standard .NETMF class PWM. It works quite well, but the problem is timing (as usual in .NETMF :slight_smile: ). I’m not to able to Stop() pwm port 50 ms after Start(), probably because of thread context switching. Well, I can clearly hear that beep is longer than it suppose to be - I believe there is no solution in managed layer. So I’ve started with the possibility to control PWM port via RLP but with no luck. I’ve downloaded PWM header files from NXP site and tried to convert it into RLP code but I still have no sound. Has anybody any working example or suggestions how to work with PWM in RLP?

Thanks for any suggestions

is your system extremely busy and not using events? Have you tried timers? A timer that fires and shuts off the buzzer.

I have tried many techniques how to shut down the buzzer but the result isn’t perfect even in the case when I’m using timers. There is a lot of network communication in the background, some GUI etc.