4

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?

Kenneth
  • 155
  • 4
  • 1
    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? – Pentium100 Apr 19 '12 at 09:46
  • 4
    It would help us to help you if you can post a schematic. – Rocketmagnet Apr 19 '12 at 09:56
  • @Pentium100 Currently I'm not using any capacitors at the power pins. The mega8 uses 1MHz. internal clock but the ICs are triggered much slower than that 30 - 60Hz. The ground pins are directly connected but I thought that one was connected through the ISP power supply and one through the circuit power supply that was part of the problem. And finally, no output pins are crossed. I walked through the circuit step by step before posting (no need for embarrassing in that manner). – Kenneth Apr 19 '12 at 22:38
  • 1
    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... – supercat Apr 19 '12 at 23:15
  • 1
    ...so it too needs a bypass cap. Of course, the processor has lots of internal state, so it definitely needs a bypass cap. – supercat Apr 19 '12 at 23:16
  • @supercat: I asked a colleague about bypass caps when I started and was told that caps directly on output pins would be very hard on the IC so I should avoid those. I will add 100nF caps and see what happens. – Kenneth Apr 20 '12 at 09:12
  • 2
    @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. – supercat Apr 20 '12 at 14:55
  • The schematic link seems to be down, can anyone else confirm? If it's still in your cache, please edit the post so that this piece of information is on our dedicated image host, rather than the currently broken link. – Kevin Vermeer May 14 '12 at 18:17
  • The image is on ImageShack as described somewhere on this site. I was not aware that you needed to log in regularly to ImageShack in order for the link to remain valid. Is there a better option for posting images than this? – Kenneth May 16 '12 at 07:49

1 Answers1

10

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?

stevenvh
  • 145,145
  • 21
  • 455
  • 667
  • 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? – Kenneth Apr 19 '12 at 16:12
  • @Kenneth Connect both grounds and measure the current. If it is small, then there is no problem. – Pentium100 Apr 20 '12 at 03:38
  • @Kenneth: how can you have a 0.5V difference if they're connected? If there's one connection to be made it's ground! – Federico Russo Apr 20 '12 at 10:46
  • @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? – Kenneth Apr 22 '12 at 21:20
  • 1
    @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. – Federico Russo Apr 23 '12 at 09:30
  • @FedericoRusso That makes sense. I take it that the voltage I was seeing was a random floating value. – Kenneth Apr 23 '12 at 10:30
  • @Kenneth: In case of doubt you can always connect the two grounds via a resistor. Chances are that the voltage drops to zero, even with a resistor value of several k. Note: that's just for testing! In operation you want zero resistance between the two grounds! – Federico Russo Apr 23 '12 at 10:52