• AVR Freaks

Helpful ReplyHot!dsPIC33CK: how to toggle PWM Output with a single external Input?

Author
Gee1
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2018/02/19 05:36:49
  • Location: 0
  • Status: offline
2019/11/05 17:00:37 (permalink)
0

dsPIC33CK: how to toggle PWM Output with a single external Input?

Is it possible to (hardware) activate / deactivate  the PWM1 Module with a single RP Pin without using CPU polling?
 
 
#1
mpgmike
Super Member
  • Total Posts : 342
  • Reward points : 0
  • Joined: 2014/01/23 17:27:06
  • Location: NJ
  • Status: online
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/05 19:54:53 (permalink)
0
Possibly an INT0 or CNx Interrupt where the ISR disables it.  That way it is instant and you don't need to tie up the processor checking.

I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
#2
NorthGuy
Super Member
  • Total Posts : 5880
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: online
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/05 20:14:24 (permalink)
5 (2)
You can pass the PWM output through CLC, this way you can combine it with an external signal.
#3
T Yorky
Super (Thick) Member
  • Total Posts : 536
  • Reward points : 0
  • Joined: 2012/08/28 02:07:35
  • Location: UK
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 08:44:38 (permalink) ☄ Helpfulby Gee1 2019/11/06 17:56:53
0
The PWM module can implement a 'FAULT' input. This can be latching or non-latching. If you use the non latching the PWM will re-start when the signal is removed. The re-start is always on the next full cycle. It does not start part way through the PWM period. There is a register that configures active/fault states.
#4
spdmtl
New Member
  • Total Posts : 21
  • Reward points : 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 09:35:21 (permalink) ☄ Helpfulby Gee1 2019/11/06 17:58:23
0
The CK's PMW 'PCI' (PWM control input) feature is intended for this purpose. It can be used to trigger or gate any PWM from any device pin, including logic.
Also see the PWM FRM referecened on web or in Datasheet for details.

Attached Image(s)

#5
spdmtl
New Member
  • Total Posts : 21
  • Reward points : 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 09:38:48 (permalink) ☄ Helpfulby Gee1 2019/11/06 17:59:47
0
T Yorky
The PWM module can implement a 'FAULT' input. This can be latching or non-latching. If you use the non latching the PWM will re-start when the signal is removed. The re-start is always on the next full cycle. It does not start part way through the PWM period. There is a register that configures active/fault states.


This is not true for the PWM in the newer 33C devices that this thread it based on. The re-start is configurable and can be done in latched or non latched (any of the 6 modes).  There is also a 're-triggerable' mode that allows multiple trigger/cycle starts within a single cycle.
 
I think your statement is intended for the older PWM in EP and FJ devices.
#6
spdmtl
New Member
  • Total Posts : 21
  • Reward points : 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 09:47:23 (permalink) ☄ Helpfulby Gee1 2019/11/06 17:59:50
0
NorthGuy
You can pass the PWM output through CLC, this way you can combine it with an external signal.


This is a good suggestion and will work, however the PWM already internally supports this type of functionality with the PCI.  The CLC is connected to the PCI as well to build even more complex logic. Can be useful for many things and is all HW based.
#7
T Yorky
Super (Thick) Member
  • Total Posts : 536
  • Reward points : 0
  • Joined: 2012/08/28 02:07:35
  • Location: UK
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 15:06:20 (permalink)
0
@spdmtl, yep you're right I have experience on the FJ and EP. Not used the CK. Probably never will. All new products on 32bit. I know that MChip have many, many flavours of PWM and Out Compare. Probably the CK has yet another. But I would have thought that the feature I have mentioned is present. I can not see MChip removing it. Maybe under a different name. It is essential for inverters to provide current limiting and tripping. Most FETs will not survive beyond 10uSec Short Cct. Most devices allow the remap of fault to comparator output for current protection.
#8
Gee1
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2018/02/19 05:36:49
  • Location: 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/06 18:04:38 (permalink)
0
the non latching with auto restart sounds good for me.. but how do i have to configure the PCI to activate this function for PWM1 ? There are soo many registers for PCI and i cant see through the documentation
 
PWMEVTy : here are only output signals, eg. "PCI Fault active output signal" but i need to configure a input right?
post edited by Gee1 - 2019/11/06 18:15:57
#9
Gee1
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2018/02/19 05:36:49
  • Location: 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/07 01:25:54 (permalink)
0
ok now it works fine. Thank u guys :)
#10
spdmtl
New Member
  • Total Posts : 21
  • Reward points : 0
  • Status: offline
Re: dsPIC33CK: how to toggle PWM Output with a single external Input? 2019/11/07 06:04:33 (permalink)
0
T Yorky
@spdmtl, yep you're right I have experience on the FJ and EP. Not used the CK. Probably never will. All new products on 32bit. I know that MChip have many, many flavours of PWM and Out Compare. Probably the CK has yet another. But I would have thought that the feature I have mentioned is present. I can not see MChip removing it. Maybe under a different name. It is essential for inverters to provide current limiting and tripping. Most FETs will not survive beyond 10uSec Short Cct. Most devices allow the remap of fault to comparator output for current protection.


Hi Yorky, There are 4 PCI blocks per PWM. 3 of the 4 can be used for 'fault' gating of the outputs. They are named 'fault', 'current limit', and 'feed forward'. The 'sync' PCI is used mainly for trigger/synchronization. The cmps can be connected to any and all PCIs.


As with improved capabilities, there come more registers, complication and corner cases. 
post edited by spdmtl - 2019/11/07 06:10:39
#11
Jump to:
© 2020 APG vNext Commercial Version 4.5