gingercat Posted June 27, 2004 Report Share Posted June 27, 2004 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. Quote Link to comment Share on other sites More sharing options...
Per S Posted June 27, 2004 Report Share Posted June 27, 2004 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] disabledPer S Quote Link to comment Share on other sites More sharing options...
gingercat Posted June 28, 2004 Author Report Share Posted June 28, 2004 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. Quote Link to comment Share on other sites More sharing options...
titan Posted June 28, 2004 Report Share Posted June 28, 2004 HelloThe 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 Quote Link to comment Share on other sites More sharing options...
gingercat Posted June 28, 2004 Author Report Share Posted June 28, 2004 Cheers Titan!That makes sense. I'm a software developer so haven't managed to get my brain into a hardware gear yet.Yay, time to improve my soldering skills a bit more :) Quote Link to comment Share on other sites More sharing options...
gingercat Posted June 29, 2004 Author Report Share Posted June 29, 2004 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. Quote Link to comment Share on other sites More sharing options...
titan Posted June 29, 2004 Report Share Posted June 29, 2004 I'm sure this is a SW problem, maybe the programm doesnt check at the start the state. The hardware modification must work! Quote Link to comment Share on other sites More sharing options...
gingercat Posted June 30, 2004 Author Report Share Posted June 30, 2004 Could TK perhaps confirm what the DINs are initialised to in software? I'm not really up to speed with assembly so can't decipher what's going on in MIOS. Cheers,Chris. Quote Link to comment Share on other sites More sharing options...
TK. Posted June 30, 2004 Report Share Posted June 30, 2004 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 1MIDIO 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.