Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crosstalk between PIC outputs

Status
Not open for further replies.

BobW

Active Member
I'm trying to track down the source of a glitch that's occurring on one of the digital output lines on a 16F630. When there is no significant load on the pin, it works fine. However, as the resistive load is increased closer to the line's maximum allowable current of 25 mA, strange things start to happen. On 0 to 1 transitions, there appears to be what looks like ringing. It's actually a series of evenly spaced pulses which suspiciously appear to mimic an output signal that's on another digital output line on a different port. I should point out that the total I/O current draw for all I/O lines is within spec.

I'm not totally convinced that this is crosstalk, but I haven't ruled it out either. Debugging the problem is a bit tricky at the moment, because the device is at a customer's site several hundred miles away. I'm relying on tests that their technical staff are able to carry out. I have some scope traces, but can't play with it in real time at the moment.

Just wondering if anyone else has experienced similar erratic behaviour on output lines.
 
If you haven't already fitted decoupling, try putting a 47uF aluminium electrolytic capacitor in parallel with a 100nF ceramic capacitor across the supply pins of the PIC16F630. Alternatively you could use a single 22uF ceramic capacitor, but not surface mount types.

spec
 
We have a 100 nF decoupling cap across the PIC power supply pins, but no electrolytic specifically dedicated to the PIC. A 47µF cap seems to me to be a bit excessive for decoupling a single device.
The glitches are a series of 2 µs wide positive going spikes, spaced about 300 µs apart. Looks like there are about 20 of them, from what I can tell from the grainy digital scope trace they sent me. I hate digital scopes. The glitch pulses are all equal amplitude with the peak at about 66% of Vcc. They are all exactly the same amplitude; they don't don't decrease. So, I'm ruling out ringing. This spurious signal lasts for about 6 ms before the output actually transitions from 0 to 1. At the moment, I'm not entirely sure if these spikes begin at the time when the output is supposed to transition or if they end at that point. Sorry if I sound vague, I'm still trying to understand the information I've been sent.
 
We have a 100 nF decoupling cap across the PIC power supply pins, but no electrolytic specifically dedicated to the PIC. A 47µF cap seems to me to be a bit excessive for decoupling a single device.
The glitches are a series of 2 µs wide positive going spikes, spaced about 300 µs apart. Looks like there are about 20 of them, from what I can tell from the grainy digital scope trace they sent me. I hate digital scopes. The glitch pulses are all equal amplitude with the peak at about 66% of Vcc. They are all exactly the same amplitude; they don't don't decrease. So, I'm ruling out ringing. This spurious signal lasts for about 6 ms before the output actually transitions from 0 to 1. At the moment, I'm not entirely sure if these spikes begin at the time when the output is supposed to transition or if they end at that point. Sorry if I sound vague, I'm still trying to understand the information I've been sent.
Hmm, as you already have a 100nF decoupling capacitor across the supply rails, decoupling is probably not the problem. All the same, I would try adding the capacitors I suggested, especially the 47uF capacitor- it costs nothing to try.:)

spec
 
Why would you design a circuit to allow for maximum draw from an I/O pin? 25mA is an absolute maximum rating. Not a typical recommend design practice.

Furthermore, around 15mA, you start to hit the RdsOn spec of the output driver and will see an output voltage drop as you go from 15-25mA.

While the output drivers of a microcontroller are strong, the purpose of microcontroller outputs is to generate signals...not source the final load current.
 
Why would you design a circuit to allow for maximum draw from an I/O pin? 25mA is an absolute maximum rating. Not a typical recommend design practice.
Good question. The short answer is that this was not the original design intent. It was only supposed to drive some high impedance logic devices, but the requirements have evolved as they often do, and there has now been some additional circuitry hung on the PIC outputs. We will add some buffers to deal with this, but I'm still curious as to why the output wasn't simply dragged down instead of getting the strange sequence of spikes before the output changes.
 
You mentioned that the spikes appear to mimic another output pin. What is on the other output pin? Is a circuit diagram available. Also, do you use a shadow registers to avoid RMW problems?

Mike.
 
The other output pin is a clock output that I'm using to bit bang data in from another device, but it's not even on the same port. The spikes appear on Port A bit 2, and the clock signal is port C bit 1. We are using shadow registers.
I think I may have tracked down the problem. There may be a bad trace on the PC board that has left one of the inputs floating.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top