hi, let we post anything about design rule here, such as TTL/CMOS/MCU.
i.e. you need to obey this rule so that you cant get ripple/spikes in your supply. or if you're interfacing to these condition you need to do this and that.

i just experienced a wierd thing. someday ago, i built a 8051 circuit with nothing special but one port used to drive something, the other is left floated . i was testing my 7805 first with oscop, to ensure i'm getting a good clean supply. and after satisfied, i put the mcu to the socket, and what! i see a very big ripple there >(

i want to test if i got these floated pin to connect to the 5V directly. but, before that, anyone can suggest/comment what is really happen here? why? is it because the floating pins? should i left the pins connected to +vcc or gnd, or with a pullup to the vcc?

Posted on 2003-05-29 22:12:14 by dion
Perhaps the filter cap coming out of the 7805 isn't large enough. Also remember each chip, especially an mcu, needs a cap right at the +5v pin. I don't remember how big it needs to be. If you have the spec sheet for the 8051, it should say what must be done with floating output pins. Floating inputs are a definite no, no. But outputs can usually be left alone. I'm surprised the output port your using has so much ripple in it so I suspect the cap issue.
Posted on 2003-05-30 09:52:50 by drhowarddrfine
A large ripple at an output sounds like poor power supply decoupling. But not only.

First I would check if the ripple is present on the power supply. If not, check the connections to those pins that have "ripple". It could be produced by something else.
Then, I would check if the ripple is at the line frequency, which could mean the regulator has insufficient input voltage.

Also, if one port is driving something, make sure that load does not sink too high currents for the amount of capacitance you have on board.
To verify that, check if the ripple changes at the same time as the driving signals.
It can also happen for the regulator to go into current limit if the load is really heavy (unlikely, but it can happen with heavy loads, driven using power drivers).

Try using a separate power for that load. Use heavy decoupling for that load. Keep the important power supply "clean".

If I remember correctly, the 8051 has internal pullups for all ports, except port 0. If that is true (verify, I don't remember for sure!), you can leave them unconnected, they will be pulled high. However, if you tie these pins to Vcc and one of them is turned ON by your program, you know where the ripple is coming from.
Posted on 2003-05-30 11:56:02 by VVV
This doesn't sound like the output of the 7805 (which is a +5V regulator) oscillating from some instability. They are usually quite stable, I've never been able to make one oscillate.

Its possible the 8051 is drawing a lot of current once it starts up, way too much for the regulator to provide. That will drive the 5 volts way down, which resets to 8051, which unloads the reg so it outputs 5V again, and so on. Kind of like an oscillation.

My first guess would be the INPUT to the 7805; can it provide the required current? If not, its gonna ripple itself, and if the input V to the 7805 drops enough, the output will drop too.

Easiest way to check this is to line trigger your scope. If the ripple is in sync, bingo, its the input. If not, the output load is too high.
Posted on 2003-05-30 22:34:38 by Ernie
the power supply is used for my bench, so it wont be the source, because i used it to test arcade boards and seeing no ripple . the current is big enough that it would burn a needle a half. i had use a cap 100uF/16V at pin 3 of 7805 to the gnd as usual. i do nothing with the mcu but only driving one pin, that is connected to a transistor and driving a relay. if i unplug the mcu from the socket, the line is clean. but if i plug it into the socket, its act like crazy ripple. yes, unconnected port verified to be pulled high. but i dont check port 0. now i am more confused :(
Posted on 2003-05-31 02:59:12 by dion
For a bench supply, you *really* want something you can regulate both the voltage and current. Too much current in debug test is a bad thing, you'll smoke too many parts.

Having the supply run the 7805 is a little better, as that will limit the current to about an amp, still well capable of smoking parts, but may leave wires intact.

Once I was troubleshoooting something someone had powered from a BATTERY, and when I shorted leads the power wires melted.. Moral: LIMIT THE CURRENT.

Troubleshooting is a series of (hopefully intelegent) guesses, try something, see if it works, try something else. My guess is it is not floating inputs causing this, to rule it out you could tack a wire to all inputs and ground them out, see if the coltage goes normal.

I'd be more concerned you have an output mistakenly grounded that's making the mcu draw way too much current. IF your mcu is a nice DIP package, try bending all the IO leads slightly up so they miss the socket and put it back. Just try VCC and ground first if you can. Then put back a pin at a time till the voltage problem comes back.

You may mangle one or two mcu ICs this way, but it will get you going again.

If your ICs are too valuable to mangle, perhaps you want to get another socket and try this by re-building another copy of the mcu socket wire by wire until the problem re-appears.

Hope this helps.

Next time, could you post either the full part numbers of the 7805 and the mcu, links to their data sheets is cool (or not, I'll find em), and maybe your schmatic too.

Posted on 2003-05-31 14:09:51 by Ernie
It seems I was right about the 8051 ports. Port 0 is the only true bi-directional port. Therefore, if you use it for input, make sure you connects its pins to either GND, or pulled to Vcc. If you are using the uC with external memory, then you don't need to do anything about port 0. The uC will make it an input or output as required.

First you need to check the frequency of the ripple, and see if you can match it to any of the signals on board. That will give you some clues.

The line you mention, with the ripple, is it the +5V line?
Skinny traces and insufficient decoupling can cause all kinds of problems. Therefore, try adding capacitance (1uF tantalum) at the 8051 power pin.

Is that relay powered from the +5V? If so, maybe the relay draws too much current and it causes the "ripple".
Add a 100uF cap from +5V to GND, right where the relay is connected.

Is there any other significant load switched on and off on that board?
Posted on 2003-05-31 18:12:15 by VVV
Off topic a bit, but i wonder if it would be worth looking into a web applet or something that would allow posting small images (small schematics). Kinda like Hiro's email conversion, only for schematics... probably would be difficult to find tho (or time consuming to desing).
Posted on 2003-05-31 18:15:17 by NaN
hi all, i just built another one with same mcu , now with several pins connected . but now, i dont use 7805. guess what! the supply line [+5V] is okay, although it have a little, but i think its litte enough and wont bother someone. but the board before, which is using 7805 , and using 100uF cap, , the ripple is taking a alomost whole 5V region, and the wierd the gnd line is affected too.

why i must use 7805? because i will use the board not with a power supply right now i used in the bench , but with an 12V auto trafo, using regular diodes and a cap, then yup, the notorious 7805 :tongue: and a cap [ next time i'll try to combine 1 uF with 100uF].

for the bench, i think 7805 wont enough btw, because i dont testing my own board, but a video games board, which is, have default using this kind of power supply box.

nope, the relay is connected to 12V. that's why i used a npn transistor first :) and at that time, i test the board on scope, i dont connecting it yet.

about schematic. i though the schematic dont have something special. i'll try hardly to attach a pic next time i post something. the problem is it was taking a lot of time .

Easiest way to check this is to line trigger your scope. If the ripple is in sync, bingo, its the input. If not, the output load is too high.

hi Ernie, could you explain this one more detail? as i am not so intelligent in using scope, what you mean by "trigger your scope"?
Posted on 2003-06-02 06:16:46 by dion
The 'classic' analog oscilloscope was really only useful for periodic waveforms. They sweeo a beam left to right at a precise rate of time, while the voltage at the probe tip drives the 'dot' up and down.

Say you want to see ripple on your power supply line. You would set the trigger to the channel you connect to the supply, and adjust the trigger threshold voltage so as the ripple passes thru this voltage, the horizontal (side to side) sweep is triggered. Since the waveform looks the same over and over, you see a continious, persistant waveform on the screen.

If you have a newer digital scope the same rule applies for AUTO sync. If it didn't, you would just see a jumble of dots between the voltage min and max. (Where the digital scope excells is in single sweep displays, as it remembers every bit and can make a static persistant display from them).

Usually, you have three trigger types: AUTO will either trigger at a voltage you set, or if no trigger happens after a while, the trigger is AUTOmatically inserted. Good for reading DC levels that lack a transistion edge to lock to.

A NORMAL trigger (something I don't normally use) will ONLY trigger when the input passes thru the voltage you set, otherwise no left to right trip by the bean is made.

The third type of trigger is LINE. This trigger ignores your probe and instead looks at the power line that keeps the scope on, and locks the display to that. If the power line I first discussed has the ripple at the power line frequency. If you line lock the display, you will still see a static display.

(this is probably a horrible description, I'll try again later, very tired tonight)
Posted on 2003-06-02 22:44:12 by Ernie

Off topic a bit, but i wonder if it would be worth looking into a web applet or something that would allow posting small images (small schematics). Kinda like Hiro's email conversion, only for schematics... probably would be difficult to find tho (or time consuming to desing).

what is it exactly that you need?
Posted on 2003-06-03 04:32:50 by Hiroshimator
hi Ernie, is it like a quick sample n hold action?

really, i can see a transition edge!!! then i can see a bounce happen too with my switch??? for AUTO setting? but, its not in analog one :( you describe the three are for digital scope, isnt it?

i dont undestand what you mean in the LINE trigger. the line gets locked? you mean i'll see a static ripple display? maybe some picture if you have, please :)

Hiro: hmm... maybe something like this:
R1-R2-TR1(B)NPN; TR1(E)-GND; TR1(C)-Re; 

that would be generate a picture contain 2 ressitor with last connected to tr1 base and the emitter is gnd and soon. dont know what NaN want, is it like this NaN?
Posted on 2003-06-03 06:14:28 by dion
OK, say you have a nice simple sine wave on your scope. Set trigger type to AUTO (or LEVEL if it has it). Now intentionally turn the trigger threshold to one end or another, so the scope looses the trigger.

You see the sine wave moving side to side, as the sweep randomly picks up any part of the wave to draw it. That's loss of synch lock.

Now imagine your sine wave was from the AC line, say its the output of a step-down transformer. If you now LINE synch the display, the sine wave will look normal, with every retrace overlapping the previous one, so you see a single bright sine wave line.

Thats because the LINE synch uses the power line frequency as the source of the trigger, and here we're using the same line to make the sine wave. It works the same way for power supply ripple, and even AC hum pick-up.

It's because it's so frequent that you want to check if a signal is running at the power line frequency that scope makers add this feature.
Posted on 2003-06-05 18:01:16 by Ernie