Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Debounce problem or something else?

Status
Not open for further replies.

gargamel011

Newbie
Joined
Sep 10, 2006
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Belgrade, Serbia
Activity points
1,326
I have problem with my project. The schematic is presented in attachment.
This electronic circuit is for 5-digit seven segment displays (made from LED).
Selecting the digit that should be changed is made by pressing SET push button
and the digit that is selected start blinking. Then using UP&DOWN push buttons
set up right number on selected digit and again press SET to move to another digit,
when all 5 digits are set 6 press of SET button set selected number on display.
Since I've didn't (as you can see on schematic) put any debounce filter on RB0-RB2
PUSH BUTTON pins I've used software debounce routine in mikroBasic, waiting 20mS.

Code:
if (Button (PORTB,1,20,0)) then
             Inc (digit)
                 while (RB1_bit <> 1)
                    if (digit > 11) then
                    digit=0
                    end if
                    cifre_array[n-1] = digit
                 wend
             end if

Now my problem is I have to use 5m cable to connect push buttons
to this PCB and when everything is powered up it start working OK
but after few days when I press SET button it runs over two, three
digits like in debouncing and when I want to set number with UP or DOWN
button it's almost impossible to get (stop on) the right number.
Does any one have idea what can I do to solve this problem.

Thanks in advance.
 

Attachments

  • seven.jpg
    seven.jpg
    137.9 KB · Views: 66

I don't know mikrobasic, but is that "Button" routine supposed to do the debouncing? If the thing works with a short cable, but not a 5m one, then you are probably picking up noise in the cable. Do you have internal pullups enabled on the PIC inputs? (I don't think it would work otherwise). Another thing to consider is the capacitance of the cable, maybe that's messing up things.

But I would mostly suspect your debouncing/button reading routine. And it's a little puzzling that it 'works for a few days' and then fails. If you power cycle it does it start working properly again? Is something getting overheated?
 

Code:
sub function Button(dim byref port as byte, dim pin, time,
active_state as byte) as byte

Returns 0 or 255.

Function eliminates the influence of contact flickering upon pressing a button
(debouncing).
Parameter port specifies the location of the button; parameter pin is the pin
number on designated port and goes from 0..7; parameter time is a debounce
period in milliseconds; parameter active_state can be either 0 or 1, and it
determines if the button is active upon logical zero or logical one.

Yes I have internal pullups enabled on input pins.
The cable is STP cat 6.
Yes the biggest question is why everything works for few days and then start problems?
As for overheating I have problems with resisotors on base of BC327 they are overheating.
First I've used 470ohm 1/4W and then replace them with 910ohm 0.6W and they are also
overheating, less then 470ohm but they get hot. Any suggestion about that?
V+ is 12V.
 

After closer inspection, you've got a circuit problem. You've got 12 volts pulling up the bases of your transistors through RN2, and your pic is running off 5volts. You can't do that, you'll probably damage the pic output ports. My guess is that your poor PIC is getting toasted.
 

No,no transistors base are connected to output of IC5 and it's uln2803 (sorry for bad labeling of circuits on the schematic).
ULN2803 sink the current from base of transistors so I think that is OK, unless...
 

Ah, ok. I missed that. As far as your resistors getting hot, a 470 ohm will be dissipating about 0.3W, so I'd expect it to get pretty hot. But that's a fairly hefty base current-about 25mA; I don't think you need that much. If your circuit is sitting in an enclosure, it might be getting overheated just from those resistors.
 

Yes 470ohm were to hot(I'we calculated them wrong) but then I replace them with 910ohm 0.6W
and I still have problem with heating of the resistors, less than with 470 but still to much.
And the circuit is in enclosure so you think that overheating can cause that kind of problems?
 

With 910 ohms you'll dissipate 0.15 W in each of the 8 base resistors-that's over 1 Watt total. Add to that the power dissipated in the RN2 pullups (value?) and you've got quite a bit of heat. I can't tell you how much the temperature is going to rise, but the fact that things work for a while and then stop can definitely be an indication of an overheating problem.
 

I will try to check if the overheating is problem. I'll put one circuit in enclosure and one not and try them to see what will happen.
If the problem occurs with one in the enclosure I'll change their places and try again to see what we happen.

Anyway thanks for help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top