Jump to content

Help on Basic NGC Button-Events


julle
 Share

Recommended Posts

Hey,

 

i just uploaded the MIOS_Bootloader to a STM32F4-Board and added a SD-Card to it to test some basic USB-Midi Stuff.

I Added one active-High Button to the D0 Pin and want to get some Midi-CC-Message out of it.

My NGC-File looks like this:

 

# Reset to default
RESET_HW

EVENT_BUTTON id=1  hw_id=1  type=CC chn= 1 cc= 16  range=  0:127 ports=1111000000000000 

# Misc. Configuration
DebounceCtr 20
GlobalChannel 0
AllNotesOffChannel 0
ConvertNoteOffToOn0 1

 

But there is no Action at all in the MIOS-Studio and no Message in MidiOX at MIDIIN2, MIDIIN3 and MIDIIN4 ( cant monitor IN1 because of MIOS-Studio).

Or isnt it possible to use the onboard Digital-IO for Midi-Messages?

Is hw_id=1 the Button at D0 ?

 

Hopefully some1 can help me to get into this Basic-Stuff...

 

Julian

Edited by julle
Link to comment
Share on other sites

Hi Julian,

 

button ids are normally mapped to digital inputs of MBHP_DIN modules connected to the SRIO chain via J8/9

 

If you want to trigger button events with J10A:D0..D7, you could use the button emulation function of the SCS (because the SCS is normally connected to J10A)

 

So, please try:

RESET_HW

# the SCS should emulate button/enc functions in main page
SCS soft1_button_emu_id=2000 \
    soft2_button_emu_id=2001 \
    soft3_button_emu_id=2002 \
    soft4_button_emu_id=2003 \
    shift_button_emu_id=2004 \
    enc_emu_id=2000

EVENT_BUTTON id=2000 type=CC chn=1 cc=16 range=0:127 ports=1111000000000000
EVENT_BUTTON id=2001 type=CC chn=1 cc=17 range=0:127 ports=1111000000000000
EVENT_BUTTON id=2002 type=CC chn=1 cc=18 range=0:127 ports=1111000000000000
EVENT_BUTTON id=2003 type=CC chn=1 cc=19 range=0:127 ports=1111000000000000
EVENT_BUTTON id=2004 type=CC chn=1 cc=20 range=0:127 ports=1111000000000000

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Hey Thorsten,
 
There is still no function :(
 
Normally there should be a feedback in MIOSstudio if a midimessage is sent, right? 
 
My current Testcode:
# Reset to default
RESET_HW

# the SCS should emulate button/enc functions in main page
SCS soft1_button_emu_id=2000

EVENT_BUTTON id=2000 type=CC chn=1 cc=17 range=0:127 ports=1111000000000000

# Misc. Configuration
DebounceCtr 20

I connected a button at D0 (PE8 at STM) according the SCS-Schematics:

http://ucapps.de/midibox_ng/mbng_scs.pdf

So Id=2000 should be PE8?

 

Any other ideas what could be wrong?

 

Screenshot of MIOSStudio: 

 

KpbgIKk.png

 

 

Edited by julle
Link to comment
Share on other sites

Wohoo it works ! :) Thank you Thorsten.

 

For the wiring of the inputstuff im fixed to the SCS-schematic? So i cant put a encoder on the digital-Inputs of two buttons and vice verca?

And how can i use the J10B for connecting Buttons/Encoders? Cant find any documentation about it.

Otherwise i need to build a DIN...

Link to comment
Share on other sites

Yep, im going to build some DINs, but it would be nice if the build in IO could be used in a variable way too. ( Like Variable Encoders and Buttons on J10A/B )

This would be nice for very simple midi-controlers without the need for any additional boards.

With the buildin DIN and AIN you could already build a nice controler:
-16buttons/8Encoders

-8Pots

 

Im going to a presentation about midibox for some non-electronics-people in nuernberg and it would be cool as start to use only the STM32F4-board,some wiring and a small NGC-Script to build a little and cheap USB-midicontroler.

Just to get into the whole thing :smile:

 

( I dont find any Feature Request List )

Edited by julle
Link to comment
Share on other sites

The wishlist is located at the bottom of this file: http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2FCHANGELOG.txt

But I only take over requests where I think that they are useful for myself, and/or the implementation & testing isn't so difficult.

 

 

And how can i use the J10B for connecting Buttons/Encoders? Cant find any documentation about it.

 

 

When you don't find certain functions in the documentation, then it's very likely not available.

Either because nobody requested such a function yet, or there is a conflict with another function which you've overlooked.

 

When you are writing "Cant find any documentation about it" it sounds to me like a complaint, and not like a request!  :no:

 

J10B (on MBHP_CORE_LPC17: J28) is typically used as extension port for CLCDs/GLCDs.

Normally I prefer to use the ports only for a single purpose to avoid conflicting configurations which could lead to the next request from somebody else to make it somehow possible without considering what it means at my end. 

 

I spend some thoughts about possible solutions anyhow, and came to the conclusion that the most simple way would be to provide a new function which maps J10A/J10B to DIN or DOUT shift registers (some kind of "shift register emulation")

 

E.g. with:

DIO port=J10A  emu_din_sr=1
DIO port=J10B  emu_din_sr=2

I could provide the possibility to handle J10A and J10B pins the same way like pins of the first and second DIN shift register (id=1..16)

Advantage: this would work completely transparent for the firmware, so that encoders could be connected as well, and configured like if they are connected to shift registers.

 

With:

DIO port=J10A emu_din_sr=1
DIO port=J10B emu_dout_sr=1

it would be possible to use J10A for buttons (id=1..8), and J10B for LEDs (id=1..8)

 

Is this the right direction, or do you have something else in mind which conflicts with this approach?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

When you are writing "Cant find any documentation about it" it sounds to me like a complaint, and not like a request!   :no:

Im sorry it shouldnt sound like im complaining! :sad:  I really like your and the other guys open-source-work including the big documentation! I just wanted to get sure that i havent overlooked it in the documentation.

 

 

When you don't find certain functions in the documentation, then it's very likely not available.

Either because nobody requested such a function yet, or there is a conflict with another function which you've overlooked.

I really understand this, as im not into the firmware you´ve wrote. I just looked after the shiftregisterstuff and saw that you wrote a superfast dma-based solution  :phone:

 

 

A DIN/DOUT Emulation for these ports would be nice. In my approuch i would like to use only DIN to connect as much as possible variable input stuff (buttons/encoders) to the core.

So for "me" the best solution would be the possibility to choose if J10A/B would be DIN or DOUT. But, as you said before, im not sure if that would be easy to implement as J10A is usually the input and J10B the output of the SCS...

The codesolution looks nice!

 

About the presentation: It will be a free presentation for the guys from http://studio-eins.net/ (with the credits to your page). My plan is to show/educate them how easy and cheap it is to build your own custom midi controler with just the STm32F4 board. Therefor it would be better if no DIN is needed.

Edited by julle
Link to comment
Share on other sites

Of course, providing something to such an audience is a nice motivation :smile:

(as long as the requests don't get too illusory or clash too much with given concepts ;-)

 

Please try this version: http://www.ucapps.de/mios32/midibox_ng_v1_031_pre3.zip

 

Configuration examples can be found in cfg/test/diocfg_1.ngc:

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fdiocfg_1.ngc

 

and cfg/test/diocfg_2.ngc

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Fdiocfg_2.ngc

 

I haven't tried this, but with this new feature is should also be possible to scan a 8x8 DIN *or* a 8x8 DOUT matrix (unfortunately 3 8bit ports would be required to scan a 8x8 DIN and DOUT matrix at the same time).

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Thank you Thorsten for implementing this ! Its working like a charm and does exactly what i was thinking about ! :smile:

 

Tested it for all the pins with some buttons and encoders and its working. :phone:

Sry i cant test the matrix-Scan as i dont have one...

 

But i got some questions left:

1. As the id-mapping for the scs-ports beginns now at 1 , what happens if i would connect additional DINs? Continuing at id=17?

additional, not topic-related questions:

( 2. Dont want to ask for a new feature again, ... but is it possible to build a NG-Application with something like a default NGC, that the people at the workshop dont need to solder the sd-card interface? Of course i could compile one with some custom fixed-config code, but maybe i just overlooked that "Avoid-SD-Card"-Feature )  :pinch:

( 3. Got some odd connection Problems since yesterday, but they started BEFORE i installed your pre-Version. So they arent related to this pre-Version... )

Edited by julle
Link to comment
Share on other sites

Fine! :)

 

 

1. As the id-mapping for the scs-ports beginns now at 1 , what happens if i would connect additional DINs? Continuing at id=17?

additional, not topic-related questions:

 

The J10 ports overlay DIN shift register positions.

So, with this default example DIN 1 and 2 wouldn't have a function anymore.

If somebody would add a MBHP_DINX4 module, and still would like to use the J10A/B based inputs, he would change the emu_din_sr parameter to higher numbers (of unused DIN SR positions)

 

 

( 2. Dont want to ask for a new feature again, ... but is it possible to build a NG-Application with something like a default NGC, that the people at the workshop dont need to solder the sd-card interface? Of course i could compile one with some custom fixed-config code, but maybe i just overlooked that "Avoid-SD-Card"-Feature ) 

 

No, this isn't possible.

Just build the Low-Cost adapter as documented here: http://www.ucapps.de/mbhp_sdcard.html

 

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