Jump to content

tago

Members
  • Posts

    273
  • Joined

  • Last visited

Everything posted by tago

  1. Closer explanation: I'm building a midi keyboard controller and would like to have two switches with respective indicator LEDs as octave up/down controls. The switches and LEDs are connected to J5a.
  2. Hi, i'm trying to add some custom code to the NG app. I want to set/get a parameter called kb_transpose. It seems that this parameter is part of MBNG_EVENT_CONTROLLER_KB event. 1.) Do i have to dispatch MBNG_EVENT_CONTROLLER_KB when i want to change the value of kb_transpose? 2.) How would i get the current value of kb_transpose? As you can see i've trouble understanding how i can change parameters via code without using ngc/ngr scripts. I've no idea where parameters are stored and how i can access them. Is there a suitable tutorial for this? Your help is greatly appreciated
  3. There is this line in mbng_kb.c s8 kb_transpose = (s8)item.custom_flags.KB.kb_transpose; What is item.custom_flags.KB.kb_transpose ? It looks like the place where the current transpose value is stored. But how can i modify this value myself? Edit: Where is "item" coming from? I see it declared as "mbng_event_item_t" but not where it is referenced to any object.
  4. I'd like to know the best place for the button handler and how to get/set kb_transpose values. Here is some pseudo code. void APP_Background(void) { int old_transpose = kb_transpose; int new_transpose; // up btn pressed if( MIOS32_BOARD_J5_PinGet(0) == 0) { new_transpose = old_transpose + 12; } // down btn pressed if( MIOS32_BOARD_J5_PinGet(1) == 0) { new_transpose = old_transpose - 12; } // transpose and handle LEDs if( old_transpose != new_transpose ) { kb_transpose = new_transpose; if( new_transpose > 0 ) { // enable up LED // disable down LED } else if (new_transpose < 0 ) { // enable down LED // disable up LED } else { // disable both LEDs } } }
  5. Hi Zam, thanks for joining in. This is from the .ngc manual, right? As far as i understood i have to do it in the ng app itself and can't simply use ngc/ngr. Unfortunately i've no clue in which function i should put custom event handlers. Should i put it into APP_TICK (app.c) function? But i'm not sure about it.
  6. How can i set/get kb_transpose from within the NG app?
  7. I got the two LEDs working. I assume the switches will work too. Now i need some help or hints on the implementation of kb_transpose on these elements. In the end i'd like to have octave up/down tact switches with respective indicator LEDs, as seen on many keyboard controllers. It looks like i can't do it via ngc scripts, because there is no event for J5 digital IOs. There is only EVENT_AIN when configured as analog inputs. Is this right? But where should i put my custom button handler code in the NG app source? Do i need a new variable for the transpose state or is there already one? Any ideas? Thank you very much!
  8. Hi, i'd like to continue working on my keyboard controller project. Is there absolutely no way to set up the J5 ports as individual digital IO's in ngc? I'd like to avoid a cumbersome solution modifing the source code. If there is no easy way, then so be it. May i ask if it's possible to simply do the following? I want to setup J5a to have 2 digital ins and two digital outs. // init pin 0 and 1 as digital ins (for tact switches) MIOS32_BOARD_J5_PinInit(0, MIOS32_BOARD_PIN_MODE_INPUT_PU); MIOS32_BOARD_J5_PinInit(1, MIOS32_BOARD_PIN_MODE_INPUT_PU); // init pin 2 and 3 as digital outs (for LEDs) MIOS32_BOARD_J5_PinInit(2, MIOS32_BOARD_PIN_MODE_OUTPUT_PP); MIOS32_BOARD_J5_PinInit(3, MIOS32_BOARD_PIN_MODE_OUTPUT_PP); I assume i'd then have J5a:A0..A1 configured as INs and J5a:A2..A3 as OUTs, right? Thank you very much!
  9. One more question :) What is the 10 ohm resistor (R1) on AINSER8/64 for? Is this some kind of protection? Can i leave it out if i use a voltage reference? On the AINSER64 this is only connected to Vdd, not to the voltage regulator.
  10. Hi Zam, thanks for confirming the Vref wiring, i somehow couldn't find an example. That's why i looked at the AINSER64 schema. You're of course right about the AINSER64 connections. Sorry, i'm an idiot!
  11. Just to be sure. Vref is also used on the analog inputs J6 (AINSER8) instead of Vd (5V), right? If i connect pots to J6 they will provide max 4.096V (Vref) to the analog ins. Edit: i wonder why the external psu on AINSER64 is only connected to Vref of the ADC, but not to J6-13.
  12. I've question regarding Git. Say i want to edit the NG app which is (like all apps) part of the main mios32 repository. How would i keep track of changes to NG if i copied it out of the main repository into its own folder? There would be no git anymore.
  13. Thanks Peter! Yes, it is helpful. I understand it that way, that you recommend using a single mios32 installation as global lib. No need to put duplicates in each project folder, because the interface doesn't change often and mostly there are new functions added. Hard to decide, i somehow lean towards a self contained per project solution.
  14. Thanks Thorsten! I'd like to further understand the structure and workflow of the repository. My simplified view: it looks like /apps are the apps and everything else is the 'mios lib' (mios32/modules..). I'd like to know how do you handle changes to the 'mios lib' for all the apps? What if there are some breaking changes? Do you edit/refactor all apps every time this happens or is there some kind of a fixed API that never changes (or very seldom)? How often gets the mios stuff updated? I assume the apps are updated more frequently. I'm trying to find an ideal setup for multiple midibox projects. To my modest knowledge it's the best to have each project's includes/dependencies separated from each other to avoid problems compiling them after some time later. In that scenario i'd pull 'mios lib' version updates on per project basis, not for all projects. But does it make sense or should i rather have a global 'mios lib'? Edit: i only intend to work on app level.
  15. Hi, how do you setup multiple projects? Do you have a single mios32 installation and put your projects in folders outside of the mios32 folder? I mean, if i setup mios/toolchain/global environment vars according to the wiki docs these vars are actually global. So i don't see how this would work for different mios apps which possibly need different env vars or mios versions. Doesn't it make more sense to put a new mios installation into each project folder and get rid of the global vars to have the project's dependencies in its respective project folder? Thank you
  16. Currently no J10 in use for now. I wanted to keep J10a clear if i later want to add an SCS. Therefor J10b would be available. But the issue i found was, that you can't have mixed DIN/DOUT on a J10 port. That lead me to the J5 ports. The wiring to core would be a mess for a little board with 2 switches and 2 LEDs. ps. i want to setup two octave up/down buttons with indication LEDs
  17. Am i correct that the LM4040 has lower noise? Do you think this relevant in this use case? Otherwise it looks like you need an additional resistor with the LM4040, which i'd rather like to avoid. Maybe i should just use the MCP1541.
  18. Hi Zam, they're tact switches. I'd like to avoid additional modules for just 2 switches and 2 LEDs. A pity there is no easy way for LEDs. It means i have to add code in terms of the 'j5_outputs' example to NG app, right?
  19. Yeah, i couldn't figure out the needed input voltage either. I'd like to try it, but have to wait until i need some more components for a new order. Those shipping costs are really high if you only need some test parts.
  20. I want to connect some switches and leds directly to the CORE_STM32F4 via J5a/b ports. The NG manual shows an example using them as AINs, but not DIN/DOUT. Then i found the tutorial applications (eg polling_j5_pins) which show how to use them on app level. What i dont get, is there a way to setup these ports and its indivdual pins directly in a .NGC file?
  21. Thanks all for your help. I found the LM4040 CIZ-5,0 (link) as possible alternative to the MCP1541. Would the 4040 work as well?
  22. Thanks @FantomXR I really like your solution. The MCP1541 datasheets says 4V output. Is really enough for Vref? What effect has a 1V drop for the A/D converter? Does it mean -20% resolution? If i understand your solution correctly the quality of the Vref is more important than the voltage range. Do have to branch the USB power before it goes into the core or can use the 5V of J19 as input voltage for the MCP1541?
  23. Thanks @Zam So in my case i need a separate voltage regulator for the display, because AINSER needs the full 5V and therefor should be left alone? The displays works from 3.3V to 5V and i suppose a small voltage drop is not much of an issue. What type of regulator should i use? I read about bulk or decoupling capacitors. Do you think they could be of help?
  24. According to the HD44780 datasheet i need to send 1111/1111 to the display to enable all pixels per char, but don't know the string equivalent is to enter in the .ngc file.
  25. Thanks @jojjelito I have some further questions if you don't mind, since i don't have much experience in electronics. I'd like to power the system via a single USB port. Does a separate regulator for the display or AINSER decouple each other in a sufficiently manner? How do i get a separate AGND with CORE_STM32? Do you mean by 'other OLED PCB', the pcb on the display itself?
×
×
  • Create New...