Oct 22, 2020
06:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 22, 2020
06:48 AM
Hi,
is this possible to deinit particular modules ?
In my application there is demand for single pin to work in 2 modes, digital output and PWM (changeable in runtime).
I found that when I configure PWM signal on this pin and then I want to use digital output I cannot do this.
PWM set to mode_off hold constantly hold the line at one level that cannot be changed by Set/reset pin state functions.
Is there possibility to completely turn off PWM module, not only stop it ?
I couldn't find any iLLD functions for deiniting modules.
I work with Tc222L.
is this possible to deinit particular modules ?
In my application there is demand for single pin to work in 2 modes, digital output and PWM (changeable in runtime).
I found that when I configure PWM signal on this pin and then I want to use digital output I cannot do this.
PWM set to mode_off hold constantly hold the line at one level that cannot be changed by Set/reset pin state functions.
Is there possibility to completely turn off PWM module, not only stop it ?
I couldn't find any iLLD functions for deiniting modules.
I work with Tc222L.
- Tags:
- IFX
2 Replies
Oct 22, 2020
07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 22, 2020
07:14 AM
If you want to change an output back to GPIO, you can set its IOCR register from an alternate output function (>=1) back to GPIO (0).
For example, for pin 65 / P15.5:
That way, the PWM module can keep running, but its output is not connected to an output port.
If instead you deinitialize whichever peripheral is driving the PWM output, the output will go low and stay low. You'd still have to switch it to a GPIO to be able to control it.
For example, for pin 65 / P15.5:
P15_IOCR4.B.PC5 = 0x11; // see datasheet: O1 = TOM0_0, push pull
// ...do PWM stuff
P15_IOCR4.B.PC5 = 0x10; // see datasheet: O0 = P15.5 general purpose output, push pull
// ...do GPIO stuff
That way, the PWM module can keep running, but its output is not connected to an output port.
If instead you deinitialize whichever peripheral is driving the PWM output, the output will go low and stay low. You'd still have to switch it to a GPIO to be able to control it.
Oct 23, 2020
03:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 23, 2020
03:10 AM
Uc_wragner thanks for quick response.
That helps a lot.
That helps a lot.