Hi guys.
I’ve been working on some floorboard software.
The way it works is ain/din get information about what to do from an event table.
in the event table are the midi events name, status, and a ‘style’ definition, eg, on/off or show a bar grapgh or calculate tap tempo, etc, etc
AIN/DIN also have tables that tell them which entry to refer too.
Plus a few other tables for various things… I ran out of flash memory a loooong time ago, so now I’m trying to run the all the tables from a bankstick.
I just can’t get it to work.
I upload some information direct to bankstick with a dedicated asm file like so…
;; preload file for BankStick
list p=18f452
org 0x400000
; "Name ", Status, Param1, Param2_def
;; 0- These are the CC's
db "Volume ", 0xb0, 0x07, 0x04
db "Amp Gain ", 0xb0, 0x0c, 0x03
db "Amp Treble ", 0xb0, 0x0d, 0x03
db "Amp Mid ", 0xb0, 0x0e, 0x03
db "Amp Bass ", 0xb0, 0x0f, 0x03
db "Amp Vol ", 0xb0, 0x10, 0x04
db "Presence ", 0xb0, 0x11, 0x03
... etc
END
When I upload with MIOS studio, every section gets a recieved less bytes than expected error!! I recall the information like this: just say pin_mapped = pin for ease of understanding.
// snippet from AIN notify change
for (t=0; t<16; t++) found_event.name[t] = MIOS_BANKSTICK_Read(0x0000 + (pin_mapped * 19) + t);
found_event.status = MIOS_BANKSTICK_Read(0x0000 + (pin_mapped * 19) + 16);
found_event.param1 = MIOS_BANKSTICK_Read(0x0000 + (pin_mapped * 19) + 17);
found_event.param2_def = MIOS_BANKSTICK_Read(0x0000 + (pin_mapped * 19) + 18);
found_event is later used to send a midi event and print data on the LCD. This works for the first entry of the table, but there seems to be extra bytes between lines. I wrote a quick bankstick scanner to check the uploaded data…
// In AIN nofity change
{
bankstick_offset_LSB = (MIOS_AIN_PinGet(0)) >> 2; // 00 - ff
bankstick_offset_MSB = (MIOS_AIN_Pin7bitGet(1)) << 4; // 0000 - 7f00
MIOS_LCD_CursorSet(0x00);
MIOS_LCD_PrintHex2(MIOS_AIN_Pin7bitGet(1)); // MSB
MIOS_LCD_PrintHex2(bankstick_offset_LSB);
MIOS_LCD_CursorSet(0x40);
MIOS_LCD_PrintHex2(MIOS_BANKSTICK_Read(bankstick_offset_MSB + bankstick_offset_LSB)); // Show eeprom data
}
It shows at location 0x24 = 0xB0, 0x25 = 0xc0, 0x26 = 0x03 (which is line 2).
By my calculations that seqence should start at 0x23… which shows 0x20… There’s lot’s and lot’s of 0x20 in the eeprom, is there any significance?
So as of the second entry in the event table, I get a garbled LCD, and random MIDI out behaviour
For now I just want to ask if there something in the code above that could be causing the issues… Or should the code work. (a ‘looks fine to me’ would be much appreciated if it should be working)
Thanks!!