View previous topic :: View next topic |
Author |
Message |
notbad
Joined: 10 Jan 2013 Posts: 68
|
ECCP PWM pins safe initial state. |
Posted: Sun Apr 14, 2013 4:06 am |
|
|
quote from datasheet:
Quote: |
The PxA, PxB, PxC and PxD output latches may not be
in the proper states when the PWM module is
initialized. Enabling the PWM pin output drivers at the
same time as the Enhanced PWM modes may cause
damage to the application circuit. |
The problem about it is that the compiler sets the tris bits at the start of setup_ccpx() and having three pwms enabled, this may cause some problems to my IGBTs. What can I do to prevent this?
another question: what happens to mcu pins when the circuit is being powered? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19536
|
|
Posted: Sun Apr 14, 2013 4:24 am |
|
|
PIC pins always wake up as inputs. This is in the data sheet. This is why you _must_ ensure that signals that may cause conflicts, are biased by your external hardware to a safe condition.
Remember you can set the PWM duty to zero, before using setup_ccp. This should then ensure the pins are not driven. However if you want to delay setting TRIS, then simply set the mode on the port driving the ECCP, to use FAST_IO. The compiler won't then control the tris, and you can set it how you want after configuring the CCP.
Best Wishes |
|
|
|