[SOLVED] Interrupt llong wire problem

Status
Not open for further replies.

deeplearns

Member level 4
Joined
May 19, 2011
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Visit site
Activity points
1,939
Hi ,

I want to use the IOCB feature (PIC 18f4520) , which i have created program for but the buttons used for iocb will be through a long wire cable something like 25 to 30 mtr cable .

Now used LatC as output ports and PORTB.B4,B5,B6 as input so when i checked the logic wihtout a long wire the logic works fine , meaning no problem with S/w but when i attach it thorugh the long cable . the interrupt does not work, but the logic level at the PORt changes . I have pulled up the ports externally through 10 K resistor and Vcc . When i press the button it goes to 0 and on releasing back to 5 . But the Leds that i have used which turn on and off when interrupt occurs does not work with long cable .

What could be the problem , is it a current problem , if so can i use something like uln2803 .

Please help .

Thnx .
Deepesh .
 

Hi,

Afraid you have little chance of any usable reading with wires that length, they just act as aerials collecting all sorts of stray interference which drives the input port mad and resetting, even blowing the pic.

Even with leads just a couple of cm long can have the same result.

For short leads you can use shielded cable and input filters by the pics port, but for leads that long you will have to look as something else, perhaps a schmitt triggered Opto coupler with filters on the input?
 
I have used debounce delay internally ..through s/w .
I am creating the method for Elevator control panel . What is the button detection method in elevators , how dopes the UC detect which button is pressed then .
 

Hi,

Expect elevators use a proper comms protocol to avoid such problems.

Long wire Interference is a well known and a difficult problem to overcome.

Probably the simplest way to can eliminate it is to use opto coupler as mentioned or a reed/small relay at the micro end of the wire as close to the pic pin as possible.

Software debounce is essential but will do little against such interference, spikes ec

Do not use the micros +5v power rail to feed the Vdd over that distance, though to the elevator switch and back to micro, use a different power rail or supply otherwise you will have a similar problem on the +5v as well.
 
Good adwice sir will try and check the response , as i was really skeptical about the UC .

Thanks

- - - Updated - - -

@ wp100 ----Still a confusion ...from ur post and according to my program ..my o/p pins are LATC .. and input pin PORT B4,5,6 (Interrupts ).Now if their is a noisy spike wont the optocoupler pass it on to the ports as it is still an electrical signal , i presumed they were beneficial when something like back emf can cause ckt malfunction i.e for isolation .

Please help .
 

Hi,

Am no expert on noise etc, just looking at the simplest way to overcome your long wire problem.

Expect an opto would help reduce high frequency noise, and adding a r/c would further improve things, same with a small relay - however have never use either in this way.

As 123JACK says there are other more suitable methods but they need much more circuitry etc.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…