burrow
Full Member level 2
- Joined
- Dec 15, 2014
- Messages
- 147
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 18
- Activity points
- 1,148
Your question is ambiguous. How long are the 'log wires', what kind of wires are they and what signals do they carry? Where is the noise coming from?
MAX232 is a possible solution for slow changing signals up to lengths of maybe 100m or more but they are relatively expensive, can only carry two signals in each direction and cannot be disabled so you can't use them bidirectionally on a single wire. There are many solutions to your problem but you will have to describe it in more detail to get better advice.
Brian.
The MAX232 is not the best solution. The first thing I would try is changing the receiving 7404 to a 7414 which is a drop in replacement but with much higher noise immunity because of it's Schmitt inputs.
Your underlying problem, confirmed by the way filtering didn't help is the ground connection between the two ends. It sounds like there is enough voltage drop along the ground wire to lift the other signals into the 'no mans land' region where a signal can be interpreted as high or low. This would be particularly prevalent if you used different power sources at each end of the cable. If you have spare wires down the ribbon, connect them to ground at both ends, this will reduce the resistance and inductance, helping to keep the ground potentials as close as possible. If there are no spare wires, consider running a new wire from end to end to join the grounds.
The drawback to the MAX232 solution isn't the IC itself, it is that if you have a problem with 5V signals interacting, changing them to 24V (+12/-12) could make matters far worse. If you really need a high noise immunity over a long ribbon cable you should consider alternating signal and ground wires and if that isn't sufficient, using RS422 or similar which is good to much longer distances (> 1Km) and cheaper to implement. It does however need two wires to carry each signal.
Brian.
I'm not sure I understand the circuit. What type is U1.1? It appears to have I0 to I7 driving out to transistors and A0 to A2 driving the 7404. I'm going to guess its a 74LS148 priority encoder but if I'm right, you should tie the /E1 and /GS pins to ground for it to work properly.
At the moment you have the output of the 7404 driving a long line with a large capacitive load at it's end. That is not good practice, you will be overloading the outputs of the 7404 as they change state and that could be causing instability. At each logic level change there will be a large current spike drawn from the supply and lots of cross coupled voltages along the cable.
I would suggest you remove the 7404 completely and wire 100 Ohm resistors between the A0, A1, A2 pins of U1.1 and the cable. That will isolate the capacitance and inductance of the cable from the IC. At the PIC end, remove all the resistors and just use a single 100nF capacitor from each PIC input to it's ground pin. The signals will be inverted (or rather not inverted) but you can take care of that in the PIC program easily. Make sure in the PIC you are disabling any internal weak pull-ups that may be active on the port pins.
Let me know if that works.
Brian.
Give it a try.
What concerned me about your original method was that even if the 7404 had not been capacitively overloaded, the 10uF capacitors would have made any voltage changes (such as the noise you are seeing) very slow to react. So although you were breaking the design rules it should still have filtered out the noise. That leaves only one possibility, the logic levels themselves are not a good low and a good high and are failing to meet the necessary levels for the PIC to be sure what they were.
I think the method I suggest should work. The output drive level of the 74LS148 is the same as the 74(LS)04 so there isn't much point in using the extra IC. At the PIC end, to ensure you get the biggest voltage swing you shouldn't add a pull-up or pull-down resistor or enable the ones that may already be inside the PIC. The capacitors should work as noise filters, they will charge and discharge through the cable and 100 Ohm resistors. Make sure you connect the ground side of each capacitor close to the VSS pin of the PIC and of course make sure there are also capacitors (100nF + 10uF) directly across the VDD and VSS pins of the PIC too.
Brian.
That should work. If you remove the 7404 you could wire the 100 Ohm resistors between the original 7404 input and output holes in the board.
Your schematic shows "outputs pulled high" between the 74LS148 and 7404, if you have wired pull-up resistors there they should be removed, the 74LS148 can drive that point high by itself.
Brian.
You could try it if you still have problems but to be honest, I would consider a completely different way of wiring your circuit if it still gives trouble.
example: you could use a serial link and RS422 driver. That uses one less wire along the cable and can still let you read each of the inputs. In fact you could read each of the inputs individually rather than just the one with the highest value.
Brian.
Yes, you can do that and you probably don't need the 100 Ohm resistor. It is there on the output of the 7404 because it can source current when it's output is high and you need the resistor to limit it to a safe amount. If you use a transistor, the collector load resistor will limit the current so the extra one isn't needed.
Brian.
So what solved it>?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?