View previous topic :: View next topic |
Author |
Message |
marcusayoung
Joined: 03 Jun 2009 Posts: 28
|
PWM AMPLITUDE issue (not software related) |
Posted: Fri Oct 02, 2009 9:00 pm |
|
|
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
|
|
Posted: Sat Oct 03, 2009 1:37 am |
|
|
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
|
|
Posted: Sat Oct 03, 2009 4:04 am |
|
|
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. |
|
|
|