protofuse Posted October 3, 2009 Report Share Posted October 3, 2009 (edited) hello, when I push/release a button, and only in these case, I have a strange flow of data on my midibox midiout. here is a screenshot: values are decimal any ideas? any tips? Edited November 9, 2009 by protofuse Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2009 Report Share Posted October 3, 2009 I would propose to test the shift register connections as described here:http://www.midibox.org/dokuwiki/doku.php?id=din_moduleBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 3, 2009 Author Report Share Posted October 3, 2009 hello TKI forgot to write:I think about a code problem.indeed, there aren't randomly eventsit happens everytime I push or release a button.I rechecked my SR connections (I'm using smashTV modules core, din, ain and dout)all is ok.but my midibox send this flow of message everytime I push a button.I have to say I display "last pin pressed" on my LCD... the right number is displayed.and the right note on value is correctly sent.I think about a midi interface issue or a code issue :-(I attached the code I'm actually using for testing purpose.main.cmain.hmain.cmain.h Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2009 Report Share Posted October 3, 2009 Such informations are really relevant if you post this in a new thread!Why not using one of your older threads in the C section, so that everybody knows the history? This would result into more explicit help...However, the received events are neither defined in pot_event_map, nor button_event_map.Thats strange. It would be insteresting which events are sent when you are writing:void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam{ // a button has been pressed, send Note at channel 1 MIOS_MIDI_TxBufferPut(0x90); // Note at channel 1 MIOS_MIDI_TxBufferPut(pin); // pin number corresponds to note number MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // buttons are high-active}[/code]Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 3, 2009 Author Report Share Posted October 3, 2009 Thorsten,I wanted to separate post because I thought about separate problems.I can do as you'd prefer.your test works very fine.only note on and note off message sent!is it a type issue?my mapping array is: const unsigned char button_event_map[64][2] = { //------- clip matrix control //-------- DIN11 // Buttons 1-8 = tracks mute = channel 1-8 {0x90, 0x01}, {0x91, 0x01}, {0x92, 0x01}, {0x93, 0x01}, {0x94, 0x01}, {0x95, 0x01}, {0x96, 0x01}, {0x97, 0x01}, // Buttons scenes 1 = 9-16 = channel 1-8 {0x90, 0x02}, {0x91, 0x02}, {0x92, 0x02}, {0x93, 0x02}, {0x94, 0x02}, {0x95, 0x02}, {0x96, 0x02}, {0x97, 0x02}, // Buttons scenes 2 = 17-24 = channel 1-8 {0x90, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, // Buttons scenes 3 = 25-32 = channel 1-8 {0x90, 0x04}, {0x91, 0x04}, {0x92, 0x04}, {0x93, 0x04}, {0x94, 0x04}, {0x95, 0x04}, {0x96, 0x04}, {0x97, 0x04}, //-------- DIN12 // Buttons scenes 4 = 33-40 = channel 1-8 {0x90, 0x05}, {0x91, 0x05}, {0x92, 0x05}, {0x93, 0x05}, {0x94, 0x05}, {0x95, 0x05}, {0x96, 0x05}, {0x97, 0x05}, // Buttons scenes 5 = 41-48 = channel 1-8 {0x90, 0x06}, {0x91, 0x06}, {0x92, 0x06}, {0x93, 0x06}, {0x94, 0x06}, {0x95, 0x06}, {0x96, 0x06}, {0x97, 0x06}, // Buttons scenes 6 = 49-56 = channel 1-8 {0x90, 0x07}, {0x91, 0x07}, {0x92, 0x07}, {0x93, 0x07}, {0x94, 0x07}, {0x95, 0x07}, {0x96, 0x07}, {0x97, 0x07}, // Buttons scenes control = 57-62 = CHANNEL 16 {0x9F, 0x01}, {0x9F, 0x02}, {0x9F, 0x03}, {0x9F, 0x04}, {0x9F, 0x05}, {0x9F, 0x06}, // Buttons offset control = 63,64 = CHANNEL 16 {0x9F, 0x07}, {0x9F, 0x08} };and you learnt me const are loaded at starting time (instead of static) :) Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 3, 2009 Author Report Share Posted October 3, 2009 everything is fine now.I don't really understand.I forced (unsigned char) cast of my array value in DIN_NotifyToggle...compilation issue ??? 18F4620 specific thing ???by the way, it works fine now :) Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2009 Report Share Posted October 3, 2009 A cast shouldn't be required... which SDCC version are you using?Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 3, 2009 Author Report Share Posted October 3, 2009 E:\JU\ECLIPSE\_rootDev\protodeck_CORE_1>sdcc --version SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (MINGW32) Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2009 Report Share Posted October 3, 2009 Thats a good one.When I compare the generated _output/main.asm file with and without the cast, I don't see any difference in the assembly code. Are you sure that you haven't changed something else in addition?Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 3, 2009 Author Report Share Posted October 3, 2009 I guess you proved this doesn't change thing...so I may probably make a mistake by changing, changing and rechanging ..btw, the last code works fine.I have the same kind of problem with AINI'll track it asap!thanks a lot TK Quote Link to comment Share on other sites More sharing options...
protofuse Posted October 4, 2009 Author Report Share Posted October 4, 2009 I think the problem came from midilink command MIOS_MIDI_BeginStream and MIOS_MIDI_EndStream...Those message named "stranged" in my post were only encapsulation for midilink purpose... and my interface had a strange behaviour when it receives it ... only that.all is ok now! 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.