Glitches on Handset crosstalk on medium length cable

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've made a simple handset with five switches, on the end of about 2.5m of six-core cable.

 

It's on PORTA and I'm using the internal pullups  to hold each N/O switch high, and detecting when they are pressed and pulled low.

 

I am getting lots of glitches- each time I press a switch 1 or 2 other pins briefly go low.

 

My test routine just outputs a Hex number, so when the switch on pin 4 is pressed, for example, it should change from 0x1F to 0xF, but if I press briefly I get 0x0B or 0x0D. Hold it down and I get a stream of 0x0F.

 

Now I assume this is a cross-talk issue because of the pulse of current when I press a switch, not a debounce issue (which would give me flaky results on the pin I'm switching).

 

A 'kludge' in software would be to introduce a delay and re-read the switches after allowing time to settle, I may have to do this.

 

BUT I would rather cure the problem at source. My initial thought is a 100nF cap across each switch, but can anyone suggest a better way (other than taking 5v to the handset and having supplementary pull-ups as this would require 7-core cable and a different type of connector etc.)

Thanks

 

<edit> I should add I have checked and all the switch lines and the ground line are no more than 1 ohm.

It's me again...

Last Edited: Sat. Apr 16, 2016 - 09:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

use external pullup resistors to decrease the RC time constant. And use a proper debounce technique.

The switches may not appreciate the 100nF across their contacts. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

use external pullup resistors to decrease the RC time constant. And use a proper debounce technique.

The switches may not appreciate the 100nF across their contacts. 

 

External pullups would be useful, but are impractical without remaking the board & I'm using a 200ns debounce period!

 

Adding a 2us settle period and re-reading the port helps, 3us seems to have cured it. I suppose at 16mhz my multicore is more akin to a transmission line and a whole bunch of close coupled signals.

 

Why would the 100nF have a bad effect on the switches?

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you'll find it is capacitive coupling between the wires, not transmission line effects.

Ok, you have your 100nF cap charged with 5V, then you short circuit it with the switch. Where is the current going to flow? It will slowly chew away at your switch contacts. Having some series resistance negates these effects.

Have you tried putting a mobile phone near to your cable? Wait a little while and see what happens- especially when the phone  'phones home' or rings.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah I agree it's capacitative effects between the cores, just walked the dogs and ran a spice model in my head ;-)

 

> Ok, you have your 100nF cap charged with 5V, then you short circuit it with the switch. Where is the current going to flow? It will slowly chew away at your switch contacts.

 

Debatable, with switches rated 12V DC they should be able to switch 5V indefinitely whatever the impedance of the voltage source.

 

> Have you tried putting a mobile phone near to your cable? Wait a little while and see what happens- especially when the phone  'phones home' or rings.

 

Interesting - absolutely nothing! Not what I expected :-)

 

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, let's debate the effects of spark erosion on the contacts! The voltage rating of the switch is irrelevant. The size and composition of the contacts will determine how long the switch survives with the abuse.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

200ns is not nearly long enough for switch debounce. I'd use a millisecond! Depending on the switch, it really CAN be that long. Snap-action microswitches are the shortest and I would use some microseconds with them.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry - typo! My debounce is 200ms not ns!

 

I find this is long enough to allow single presses to be recognised reliably while also allowing a decent repeat rate if the button is held down.

It's me again...