Jump to content

Button/Led matrix and touchsensors interaction


ptitjes

Recommended Posts

Hello,

When i look in main.asm of the sm_example_v2 in the MIOS Download page, i can see that the touchsensors feature of MIOS are disabled. As i can test that yet, i would like to know if and how the touchsensor feature may interact with a led/button matrix as programmed in the example ? (I would need both...)

Thanks for your help. Didier.

Link to comment
Share on other sites

My experience with MIOS touch sensors wasn't that good... I wanted an array of them fairly close together but there was some serious crosstalk between them.

I don't think you can connect touch sensors as part of the switch matrix... switch matrix works by sinking current on one "row" of switches, i.e. one pin of DOUT is low, the others high, so that when switches are closed, the DIN inputs which are normally pulled high are pulled low. MIOS touch sensors work by DIN inputs that are NOT normally pulled high... there is a high pulse before sampling and if your finger is there, it "soaks up" the high pulse so it samples a low.

http://www.ucapps.de/mbhp/mbhp_din_touchsensors.pdf

So I'm not exactly sure how you would turn that into a matrix version... and even if you can, I'm guessing there would be some cross-talk issues with it as well.

But don't take just my word, experiment for yourself, you might have different results.

Link to comment
Share on other sites

I don't know if this is relevant - because I use an Arduino as my interface - but I found that putting a 10k resistor between signal and ground of each sensor eliminates the crosstalk, and keeps the sensor values from "drifting" w/ no input.  They now drop to 0V as soon as you let go and the voltages do not affect each other. 

Again, my circuit is Arduino-based not MB - so it may be a whole different story in your case.  HTH

http://www.soundwidgets.com/stribe/

Link to comment
Share on other sites

This is a different kind of touch sensor... detecting the touch of a conductive contact... A 10k resistor to ground is going to cause a voltage divide at the DIN input, 10k/47k*5V=1.06V, well under logic high threshhold. I think this is what your finger is doing when it touches anyway... grounding the charge with your body. (It actually works better if you ground your body).

Link to comment
Share on other sites

Sorry. Maybe i did not correctly formulate my question!

I do not want to make a matrix of touch-sensors! I want to use touch sensors *alongside* the led/button matrix.

So as the sm_example_v2 code is disabling the touchsensors, i am wondering if this is possible... Does touchsensors uses service_prepare and service_finish to enable/disable J14 or in another way ? And how is that preventing from using touchsensors alongside a led/button matrix ?

Didier.

Link to comment
Share on other sites

TK explained how the touch sensor works in MIOS, a long time ago...

http://www.midibox.org/forum/index.php?topic=1544

I don't know why the touch sensor was explicitly turned off for the switch matrix example. My guess is that it isn't relevant and you can combine touch sensors with DIN inputs not being used in the matrix.

You'll have to experiment for yourself to find out if it works.

Link to comment
Share on other sites

TK explained how the touch sensor works in MIOS, a long time ago...

http://www.midibox.org/forum/index.php?topic=1544

Ok! Great thanks as i missed that one... I now have a better view of the touchsensor story.

I don't know why the touch sensor was explicitly turned off for the switch matrix example. My guess is that it isn't relevant and you can combine touch sensors with DIN inputs not being used in the matrix.

I had the same feeling!

I planned to experiment on this, however i wanted to have a first understanding of it and maybe some people already knew if it was a show-stopper.

Link to comment
Share on other sites

When i look in main.asm of the sm_example_v2 in the MIOS Download page, i can see that the touchsensors feature of MIOS are disabled.

This is just an (educated) guess, but I'll say that's from development time, when TK was attaching a scope to that pin, and driving it at strategic places in the code to measure performance of the matrix. (A cool trick by the way, good for testing time-sensitive stuff). TK often uses that pin for that purpose.

Go ahead and use the touchsensors :)

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