CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ECCP PWM pins safe initial state.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
notbad



Joined: 10 Jan 2013
Posts: 68

View user's profile Send private message

ECCP PWM pins safe initial state.
PostPosted: Sun Apr 14, 2013 4:06 am     Reply with quote

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: 19255

View user's profile Send private message

PostPosted: Sun Apr 14, 2013 4:24 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group