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

PWM AMPLITUDE issue (not software related)

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



Joined: 03 Jun 2009
Posts: 28

View user's profile Send private message

PWM AMPLITUDE issue (not software related)
PostPosted: Fri Oct 02, 2009 9:00 pm     Reply with quote

Hi all,

Sorry this isn't a code question, but i can't turn up much in a search.

I'm using a 12F615 to output a pair of "complimentary" PWM signals on GPIO0 and GPIO2 (these are the default output pins for half-bridge operation).

I have a sampling system that is sensitive to these complimentary signals, and they must have the same high and low amplitudes by spec.

When I measure the outputs I find that the pair of signals are indeed inversions of each other, but one has a higher amplitude (GPIO2). GPIO0 swings from 0V to 4.8V, while GPIO2 swings from -0.34V to 5V. These are consistent results among three different 12F615's.

Note I have tried these two different configuration words for CCP1CON (per datasheet):

"PWM mode; P1A Active high; P1B active high"
"PWM mode; P1A Active low; P1B active low"

Anyone have similar experiences? I'd like to make sure there isn't something I've overlooked before I start throwing more hardware at it.

Thanks
Guest








PostPosted: Sat Oct 03, 2009 1:37 am     Reply with quote

This feels like a ground issue to me, have you a good grounding (0v) scheme, very unlikly to generate a -ve voltage wrt GND without a -ve supply!
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Oct 03, 2009 4:04 am     Reply with quote

If it isn't a measurement artefact, the most likely reason for the different output voltages is in the connected load. Do you observe it also with unconnected pins?

Apart from this, the processor GPIOs aren't specified to generate precise analog signals. External analog switches or possibly CMOS gates with a clean supply should be used instead.
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