pga2310 and switch bounce - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source
Home Forums Rules Articles diyAudio Store Gallery Wiki Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

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
Old 1st April 2004, 04:55 PM   #1
biff584 is offline biff584  United States
diyAudio Member
Join Date: Jun 2002
Location: Villanova, PA
Send a message via AIM to biff584
Default pga2310 and switch bounce

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.

  Reply With Quote
Old 1st April 2004, 05:04 PM   #2
diyAudio Member
bigparsnip's Avatar
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.


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.
  Reply With Quote
Old 1st April 2004, 05:07 PM   #3
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.
  Reply With Quote
Old 2nd April 2004, 11:25 PM   #4
biff584 is offline biff584  United States
diyAudio Member
Join Date: Jun 2002
Location: Villanova, PA
Send a message via AIM to biff584
Thanks for the suggesstions- I'll give them a shot.

  Reply With Quote
Old 3rd April 2004, 01:42 AM   #5
diyAudio Member
jackinnj's Avatar
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
google "PIC debounce" -- the first entry is pretty good.
  Reply With Quote


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
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?

All times are GMT. The time now is 08:53 AM.

vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Copyright 1999-2017 diyAudio

Content Relevant URLs by vBSEO 3.3.2