Jump to content

MIDIO128 default button state


gingercat
 Share

Recommended Posts

Hi All,

Just finished building my MidIO128 for use as an organ stop control unit but have come across (what I believe to be) a problem.  When powering up, all the DIN buttons effectively default to being "on" (but the corresponding outputs aren't activated).  Is there a way to make them default to being "off"?

I believe this is due to the button states are inverted for the DIN modules, but I can't be sure being a newbee to this system.

Thanks for any help!

Chris.

Link to comment
Share on other sites

A possibility is that the default setting in the INI file doesn't match your requirement.

In my organ I use +5V to set a stop on and I had to change the setting as follows:

########################################################################

# Inverse Inputs

# If Disabled: Inputs are high active

# If Enabled:  Inputs are low actvive

# Default: enabled (for MBHP DIN modules)

########################################################################

[iNVERSE_INPUTS]

  disabled

Per S

Link to comment
Share on other sites

Thanks for the tip - tried it but unfortunately, regardless of the setting, the inputs default to being in the "on" state.  This would be fine but for the fact that I want to use the "toggle" setting.  Buttons do work correctly when I press them, just that initial state I need to remedy.

Link to comment
Share on other sites

Hello

The Solution of your problem is easy.

At the moment you have pull up resistors, that means one side is connected to +5V and the other to the port. if you dont push the button, there is 5V(HIGH) measured at the port. If you press the button, you push the port to ground, and there are 0V measured(LOW)

Let's do the inverse:

Dont do the other side of the pull up on 5V but on ground, so you have a "pull down" resistor.

Inverse also the connections of the button: One side on the port , the other on ground and you willl have because of the pull down resistor default low and high when you press the button!

Dave

Link to comment
Share on other sites

Well... Did all the swapping round last night, but the DINs still default to the "on" state in the sw.

I think the problem is that they do default to on in the sw and as no button states are toggled at power up, they remain in the "on" state.

I added some (probably bad) code to the init routines to toggle the DIN values and this works for me.

Am I right - was it a sw problem?  If so, it would be nice to be able to specify another setting in the .ini file for whether the inputs should default to on or off.  This is only really required for buttons using the toggle setting.

Link to comment
Share on other sites

Hi Chris,

during startup, MIOS captures the initial state of the shift register, waits for 1.5 mS and then clears all "changed" flags. Means: the internal MIOS registers are properly initialized with the button states, and the application won't get any change notification, regardless if the DINs are 0 or 1

MIDIO has a second set of DIN values which are used for the toggle mechanism. I must say that I oversaw the possibility to use the buttons in inversion and toggle mode, therefore I forgot to implement a proper startup reset for exactly this case. I will try this in the next days.

Best Regards, Thorsten.

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...
 Share

×
×
  • Create New...