Jump to content

Button press delay


jjonas

Recommended Posts

Hi,

I tried searching the forum for "button press delay", but didn't find an answer to my question, so here goes:

My problem is that sometimes (too often) when I release a pressed button, the MBSID takes the release as a button press as well. I guess this has to do with the mechanical property of the springy buttons, so I was wondering if there is something I could do software-wise - basically change some number in a line of code, as I cannot really code anything myself - to increase the delay between button presses so that when the contact disc in the button is springing up and down during release, the MBSID would not interpret these as a button press. I don't know how much this delay is at the moment, but taking as reference ladyada's arduino button tutorial, a millisecond would seem like an ok delay..?

http://www.ladyada.net/learn/arduino/lesson5.html (section 'Brooklyn Debounce')

Link to comment
Share on other sites

Perhaps you have used the wrong resistor value for your DIN modules? You can use multiple values but there is likely a range of values that would work best (I would stick to what is documented here.

If you don't use resistors or use the wrong ones, you can have problems similar to what you are having (called debouncing).

Link to comment
Share on other sites

MIOS provides software based debouncing which can be enabled with the MIOS_SRIO_DebounceSet function: http://www.ucapps.de/mios8_fun.html#MIOS_SRIO_DebounceSet

In order to add this to the MBSID application, open src/main.inc, search for USER_Init, and write:


USER_Init
movlw 10 ; debounce for 10 mS
call MIOS_SRIO_DebounceSet
[/code]

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks for the replies! By MBSID application do you mean setup_6581.hex and setup8580.hex..? If so, I'm not sure of everything I need to do in order to compile the modified source successfully. I guess I have all the raw material from the midibox_sid_v2_0_rc38.zip, but from there on I'm not completely sure what I have to do.

There's some advice in http://www.midibox.org/dokuwiki/application_development, but the most detailed advice seems to be for Windows, and I'm on Ubuntu 11.10. I have installed sdcc and gputils. Do I need to have MIOS sources as well (From http://svnmios.midibox.org/listing.php?repname=svn.mios&path=%2Ftrunk%2Fmios%2F)? Or if not, what is the advice for Ubuntu 8.04 referring to with

MIOS_PATH="/YOUR/PATH/HERE/mios/trunk"

MIOS_BIN_PATH="/YOUR/PATH/HERE/mios/trunk/bin"

MIOS_SHELL="/bin/bash"

There's a lot of stuff in the folder of the unzipped midibox_sid_v2_0_rc38.zip, how will make know what to do..?

You bet these won't be the last questions, but thanks for your patience :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...