4
\$\begingroup\$

This is probably answered elsewhere but I can't seem to find it.

I have a circuit which uses a Mega8 to drive a couple of ICs as shown in the diagram below.

Circuit diagram http://img851.imageshack.us/img851/5741/dimmer.png

The ISP connectors in the diagram are: 1: MISO 2: VCC 3: SCK 4: MOSI 5: RESET 6: GND Alse note that the 5V power supply is actually at 4.5V and the ISP's VCC pin is not connected.

I'm seeing the flip-flops being triggered almost randomly. If I connect a resistor between the ICs in series it seems to clean up the signal, and it doesn't matter if the resistor is 10R or 10k. Does this mean that I should always use a resistor when connecting ICs even within the same logic families?

It should also be said I use an STK500s ISP to program the mega8 which means that the circuit ends up with two ground. They seem to be differing about 0.5V. The power supply is at 4.5V so the highest potential is 5V? It's a little unclear to me how these things add up but both the mega8 and the ICs are within normal operating parameters if it's 4 or 5V.

Sorry if it's long winded. I'm not sure how to explain it better. My question concerning this is:

  • Am I right in thinking the resistor cleans up the signal? And if so how do I figure out the best size for it?

  • If the mixed ground potential is causing a problem how do I isolate the two ground potentials, since both need to be connected to the mega8 during programming?

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Do you have ~100nF capacitors connected across each 74xxx power pins? What is the frequency? How does the circuit end up wit two grounds (if you connect the circuit ground to the ISP ground then they become a single ground)? Can you draw a schematic? Maybe you have two output pins connected together? \$\endgroup\$
    – Pentium100
    Apr 19, 2012 at 9:46
  • 4
    \$\begingroup\$ It would help us to help you if you can post a schematic. \$\endgroup\$ Apr 19, 2012 at 9:56
  • 1
    \$\begingroup\$ Any chip which does not have bypass caps should be expected to have its outputs and internal state change arbitrarily during the first hundred nanoseconds or so after any of its inputs changes. Any chip where such arbitrary behavior would cause problems needs a bypass cap. The only chips which do not need bypass caps are those where such behavior would have no effect on device operation. Flip flops have internal state, which would be useless if it could arbitrarily flip following a clock edge, so they need bypass caps. The decoder's output feeds the clocks of your flip flops... \$\endgroup\$
    – supercat
    Apr 19, 2012 at 23:15
  • 1
    \$\begingroup\$ ...so it too needs a bypass cap. Of course, the processor has lots of internal state, so it definitely needs a bypass cap. \$\endgroup\$
    – supercat
    Apr 19, 2012 at 23:16
  • 2
    \$\begingroup\$ @Kenneth: Bypass caps don't generally connect to output pins; they connect between the power and ground pins. The only time a bypass cap would normally connect to an output pin would be when one device is being used to supply current for another. In such a scenario, if the source device has a mode which can output limited current, it may be good to start by turning the source device on weakly to charge the cap, and then turn it on fully when operating the selectively-powered device. In such cases, using a smaller-than-normal bypass cap on the selectively-powered device is often wise. \$\endgroup\$
    – supercat
    Apr 20, 2012 at 14:55

1 Answer 1

10
\$\begingroup\$

The resistors shouldn't be necessary. Literally hundreds of millions of devices work perfectly with ICs directly connected. I blame the power supply.

Pentium100 makes an important point: especially digital ICs should be properly decoupled. If you don't, switching may cause negative spikes on the power supply, which may cause false triggers in flip-flops. Use 100nF capacitors as close as possible between Vdd and ground.

Then this fishy ground. You shouldn't have two grounds! Ground of the STK500 and your circuit should be connected, why aren't they?

\$\endgroup\$
7
  • \$\begingroup\$ Well they are but I thought that was what part of the problem. If I measure the difference between the two grounds it varies around 0.5V. If I understand you correctly connecting them together directly should not pose a problem? \$\endgroup\$
    – Kenneth
    Apr 19, 2012 at 16:12
  • \$\begingroup\$ @Kenneth Connect both grounds and measure the current. If it is small, then there is no problem. \$\endgroup\$
    – Pentium100
    Apr 20, 2012 at 3:38
  • \$\begingroup\$ @Kenneth: how can you have a 0.5V difference if they're connected? If there's one connection to be made it's ground! \$\endgroup\$ Apr 20, 2012 at 10:46
  • \$\begingroup\$ @FedericoRusso I meant the difference was there before I connected them. My worry was that differing ground potential from two different sources would cause problems. Is there some theory I need to read up on? \$\endgroup\$
    – Kenneth
    Apr 22, 2012 at 21:20
  • 1
    \$\begingroup\$ @Kenneth: measuring voltages between unconnected boards is meaningless. The meter's probes should close a loop which started with at least 1 connection, usually ground. If the probes are the only connection there can never be a closed loop, so never be current which is needed to measure a voltage difference. In theory you should always see 0V between unconnected boards. Connecting grounds means that the +5V on one board will also be seen as +5V to the other. \$\endgroup\$ Apr 23, 2012 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.