Hello,
After some tinkering, I think I solved the problem. First, I tried to create a GPIO_LDD component and share the pin with PWM. Thus, one could set output to low. It can be seen as the final comments on this blog post:
Tutorial: PWM with Processor Expert | MCU on Eclipse
Anyway, it was not working. In my project, I emulate an IR remote controller. Thus, I set up PWM to 38kHz, 33% duty cycle, and I use Enable() and Disable() functions on PWM component to control pulse generation, in time slices of 500us.
These slices are controlled by a periodic interrupt. When I stop sending the IR command, I disable the interrupt. Problem is, it may happen while PWM is on. So, I included a PWM Disable() command right after I disable the periodical interrupt.
Checking signals with a logic analyser, I found out that pin signal sometimes goes to 1. I wondered if when I disable PWM somehow the pin becomes an input, with an internal pull-up resistor. As the pin is switching a transistor, I placed a resistor between transistor base and GND. It seems that it did the job!
Any thoughts about the issue of the pin becoming an input when PWM is disabled?