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?
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?
I would propose to test the shift register connections as described here:
http://www.midibox.org/dokuwiki/doku.php?id=din_module
Best Regards, Thorsten.
hello TK
I forgot to write:
I think about a code problem.
indeed, there aren’t randomly events
it 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.c](< base_url >/applications/core/interface/file/attachment.php?id=5513)
[main.h](< base_url >/applications/core/interface/file/attachment.php?id=5514)
[main.c](< base_url >/applications/core/interface/file/attachment.php?id=6566)
[main.h](< base_url >/applications/core/interface/file/attachment.php?id=6567)
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.
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) ![]()
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 ![]()
A cast shouldn’t be required… which SDCC version are you using?
Best Regards, Thorsten.
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)
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.
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 AIN
I’ll track it asap!
thanks a lot TK
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!