|
|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc. |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
|
I am using the PIC16F877A to control ti's PGA2310 volume chip. I am going to use an optical encoder to control the volume, but I'm testing everything out with pusbuttons first. Everything is seems to be working, but the volume changes aren't smooth- the amplitude will jump over large gaps instead of steadily increase.
I think that switch-bounce could be the problem- I have the pushbuttons causing a PORTB interrupt, then a 25ms time delay to account for bounce before continuing with the code, but the output still jumps erratically. Does anyone have any suggestions/related experiences? Thanks alot. Brian. |
|
|
|
|
#2 |
|
diyAudio Member
Join Date: Apr 2003
Location: Cambridge
|
I'm not sure if this is defianatly the case for the PIC micro controlers, but if you are using an interupt you will generaly have the device run the coad for the interup when it occurs and bump any running code out of the way untill it is finished.
So, what this may mean is that for each bounce on the swithc, one interupt is being aclled, wich will form a sort of que of all of the button presses and delays and not just one button press followed by a delay which you want. If this is the broblem you are encountering, if you change they delay code slightly, so that at the start of the delay the interupt function is disabled, and then enable it at the end of the delay agin for another button press. edit: you might also want to consider what happens when the button is held down, as this may also be causing the problem (you will almost certinaly keep the button pressed down for more than 25ms when you press it) as it is recording multiple presses for each push, even if the bounce is being removed. |
|
|
|
|
#3 |
|
Banned
Join Date: Apr 2002
Location: Germany, Clausthal
|
its no difficult task to debounce switches or mechanical rotary encoders in software. My 16F628 - PGA2310 volume control does, and the 16F877 based currently under development also.
http://home.tu-clausthal.de/~tpa/PGA/03.asm |
|
|
|
|
#4 |
|
diyAudio Member
|
Thanks for the suggesstions- I'll give them a shot.
Brian. |
|
|
|
|
#5 |
|
diyAudio Member
|
google "PIC debounce" -- the first entry is pretty good.
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contact bounce | rho | Solid State | 6 | 10th March 2005 08:31 PM |
| Ground Bounce/ Oscillations in SPDIF | fmak | Digital Source | 24 | 6th March 2004 07:52 PM |
| Contact bounce (digitally controlled XO) | nuppe | Digital Source | 2 | 17th August 2003 05:45 PM |
| HOw close does driver need to be to floor to avoid floor bounce? | Kanga | Multi-Way | 8 | 24th April 2003 06:09 AM |
| Inductors before the power pins vs ground bounce | patwen | Digital Source | 4 | 4th November 2002 07:34 PM |
| New To Site? | Need Help? |
| Page generated in 0.07643 seconds (73.20% PHP - 26.80% MySQL) with 10 queries |