Author Topic: PIC16F690 - Output Pin Rippling at High Level  (Read 10110 times)

0 Members and 1 Guest are viewing this topic.

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
PIC16F690 - Output Pin Rippling at High Level
« on: October 05, 2011, 11:53:54 am »
i programmed 2 output pins of the mentioned pic, pin 1 is (yellow trace below) to output some pwm signal, and the other one, pin 2 (blue trace) to be high at some point to act as Vref for adc's reading using trimpots, and switches (normally grounded) all of them using 10K ohm current limiting resistors. i dont think current draw will be too much from my calculation/estimation. the pic Vdd (3.3V) got smd capacitor nearby as V stabilizer, but unknown capacitance. you can see in the picture, the pin 2 (blue) is rippling but pin 1 (yellow) is ok. i dont think its because the inadequate capacitance of the unknown capacitor since pin 1 is ok. is there any other possible cause for this rippling?
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #1 on: October 05, 2011, 12:01:26 pm »
Pin 1 looks a bit low in amplitude, is it being loaded?

Try touching another capacitor between VDD and VSS to see if that has any effect on the ripple.
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #2 on: October 05, 2011, 12:33:00 pm »
Pin 1 looks a bit low in amplitude, is it being loaded?
Try touching another capacitor between VDD and VSS to see if that has any effect on the ripple.
pin 1 is connected to a transistor's base driving something. in between the transistor and pin 1 is a led and 2K ohm resistor. i was probing between the led and resistor (ie the led's lead (anode) closest to pic). so resistor is between the probe and pin 1, maybe a voltage division going on there, but i'm not sure, bugging me a bit though, but not as much as the pin 2. its quite hard touching with finger in that area, the pic and cap and ground plane below it is very small area, outside the pic perimeter are just another traces connecting to other pic's pins. and both my hand are occupied while trying to get this signal (by button press and holding to something). i'll see what i can do.

i dont think (but i'm not sure either) that my poor board layout (pin signal running next to power supply line, poor grounding knowledge, poor diy etched pcb etc) cause this since this is just low speed circuit. pin 2 is probed directly (no component in between) but there's diy via there (soldered strip of wire from top to bottom through diy drilled hole :P)
« Last Edit: October 05, 2011, 12:39:46 pm by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #3 on: October 05, 2011, 01:44:36 pm »
If it was a supply decoupling problem, you would see problems on both traces.

Above Vdd-0.7v, the pullup is very weak, and at 3.3V out, pin2 would probably have very high impedance. So when you attach a probe to it, the probe acts as an antenna.  If you add a 10K resistor (or 100K) from pin 2 to Vdd or Vss, the waveform will probably look a lot better.

Richard
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #4 on: October 05, 2011, 05:42:44 pm »
If it was a supply decoupling problem, you would see problems on both traces.
it is power supply coupling problem, i've probed directly into pin 1, its the same rippling pwm. power supply is using 12V small 23A battery, stepped down to 3.3V using LTHT7333 ldo-vreg. the 3.3V supply is rippling. i'm working on it. i think its lacking the input coupler. its late will continue tomorrow. thanks guys for the thought. the LTHT7333 max current is 150mA, do you think this is enough for the pic general purpose?
« Last Edit: October 06, 2011, 04:47:44 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #5 on: October 05, 2011, 08:21:02 pm »
I think AcHmed99 has nailed it. I've seen similar output issues from an LM1117 that was just on the verge of thermal cutoff. You get very short bursts of cutoff at the start (so the voltage looks like a ~98% duty cycle square wave) which coupled with the supply capacitors gives you the ripple you are seeing. Easy test is to see how hot the regulator is getting :D Just be careful not to burn a fingertip!

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #6 on: October 06, 2011, 04:45:56 am »
sorry typo error, its HT7333, not LT
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #7 on: October 06, 2011, 05:56:28 am »
i need a big 10uF cap on the small sot32 HT7333 output to avoid rippling, but still the signal will gradually moved down creating trapezoid shape instead of square. smaller or equal than 1uF (biggest cap in smd i have) will still rippling. what a bluff!
HT7333 datasheet: http://www.datasheetcatalog.com/datasheets_pdf/H/T/7/3/HT7333.shtml
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #8 on: October 06, 2011, 07:58:30 am »
i need a big 10uF cap on the small sot32 HT7333 output to avoid rippling, but still the signal will gradually moved down creating trapezoid shape instead of square. smaller or equal than 1uF (biggest cap in smd i have) will still rippling. what a bluff!
HT7333 datasheet: http://www.datasheetcatalog.com/datasheets_pdf/H/T/7/3/HT7333.shtml

I had a situation the other day with a similar regulator but a different make. I had 10uF ceramic decoupling capacitors on the input and output but it's output had oscillations on it. I found that if I put a 10uF Tantalum in place of the original output capacitor, it fixed the problem. I can only think that the chip didn't like the low ESR of the ceramic capacitor. Depending on clock frequency, I can't imagine your PIC taking more than a few milliamps. So do you have anything else running off that supply that would take much current? If not, I can't see dissipation being a problem.



 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #9 on: October 06, 2011, 09:20:40 am »
As with most LDO regulators, the TPS73xx family requires an output capacitor for stability. A low-ESR 10-µF
solid-tantalum capacitor connected from the regulator output to ground is sufficient to ensure stability over the
full load range (see Figure 42). Adding high-frequency ceramic or film capacitors (such as power-supply bypass
capacitors for digital or analog ICs) can cause the regulator to become unstable unless the ESR of the tantalum
capacitor is less than 1.2 ? over temperature.

This is from a TI datasheet for a similar part.

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18065
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #10 on: October 06, 2011, 12:00:34 pm »
your ripple is at 5 KHz what is the PWM frequency ?
 

Offline ChrisKiwi

  • Contributor
  • Posts: 41
  • Country: nz
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #11 on: October 06, 2011, 12:20:19 pm »
When you refer to pin 1 and pin 2 what Ports.bits are you referring to as physical pin 1 is VDD.  Some Port bits are not designed to drive loads (usually RA3) and can only be used as Input.
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #12 on: October 06, 2011, 12:25:04 pm »
i'm not sure about current consumption, hard to measure on that circuit and the signal is not continuous, only on some occasion and button press, the signal only alive for 20ms and the mcu will go sleep. but from my rough calculation, its should only few tens mA max. most other power is retrieved directly from the 12v battery. tantalum or any other through holes are not tolerated, space not allowing. maybe i just live with the ripple or find replacement for the vreg which is sot-89-a pin compatible. any suggestion that needs only like 1uF coupling cap?

while quick tinkering and snap shot 8 hours ago, iirc:
1st pic: 10uF at vreg input weak battery
2nd pic: 10uF at output and/or both? cant remember strong battery
but thats using electrolytic cap... through hole... not accepted

@simon: its actually serial data like.. 10kbps... so, taking hi and lo as complete circle... its 5KHz fundamental, a coincidence? but when the signal is turned off, i still can see the supply ripple to infinitum (out of scope view), havent snap the screen for that, but can assure you it is.

@chris: its arbitrary assignment. to be precise, pin 1 is rc0, pin2 is ra0 on pic16f690. both set as output
« Last Edit: October 06, 2011, 12:31:14 pm by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #13 on: October 06, 2011, 12:37:16 pm »
just re-rough estimate the current is 8mA something, lets just say 20mA, still way below the ht7333 spec, so its coupling problem.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline ChrisKiwi

  • Contributor
  • Posts: 41
  • Country: nz
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #14 on: October 06, 2011, 01:11:18 pm »

@chris: its arbitrary assignment. to be precise, pin 1 is rc0, pin2 is ra0 on pic16f690. both set as output

According to my datasheet pin 1 is VDD and pin 2 is RA5.  RC0 is pin 16 and RA0 is pin 19.  But since neither is RA3, my original post would not apply.  Are you using #define RC0 pin1 // or something like this if you were doing it in C or to put it another way are you assigning a variable "pin1" to RC0 ?
 

Offline MechatrommerTopic starter

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #15 on: October 06, 2011, 04:36:04 pm »
According to my datasheet pin 1 is VDD and pin 2 is RA5.
i will be a hero if i can output PWM out of Vdd pin. ;)
i dont assign or define it. pic is a mess when you want to set a pin in assembly (TRIS, PORT, PIN).
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline ChrisKiwi

  • Contributor
  • Posts: 41
  • Country: nz
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #16 on: October 07, 2011, 03:32:08 am »
i will be a hero if i can output PWM out of Vdd pin. ;)
i dont assign or define it. pic is a mess when you want to set a pin in assembly (TRIS, PORT, PIN).
So you are programming in assembly, I didn't pick up on that fact.  When you referred to pin 1 I took that to mean physical pin1 on the actual IC which, as you point out, can't output PWM as it is VDD.  The only time I use assembly is when I really really really have to.  Anyway the problem seems to be solved so that is the main thing.
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: PIC16F690 - Output Pin Rippling at High Level
« Reply #17 on: October 07, 2011, 09:44:56 am »
If you can't use through hole components I guess you must only be using SMD components?

Tantalum caps are available as small as 1206 (3216 metric) "Type A" case. Plenty of surface mount aluminium electrolytic caps available as well that aren't too hard to solder.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf