I still get this strange LCD behaviour. Strange enough, the display is okay for the first few seconds. To be more specific, the display cursor is blinking exactly 16 times, then the display starts to show 16 blocks in the upper row and 16 circles in the lower row. From that moment on the display starts to blink very fast…
There are 4 DIN modules connected to the core. On the first, SR#1 is used for the touch sensors of the faders. The third and the fourth DIN module are planned for encoders, which are currently not connected. I tried to set the number of encoders to zero by using the
#define DEFAULT_NUMBER_ENCS 0
statement in setup_midibox_mf.asm. But whenever the number is smaller than one the application does not start - I only get the sysex message [tt]F0 00 00 7E 40 00 01 F7[/tt] from the core, nothing else happens. How am I supposed to set the number of encoders present to zero? ************************************************* And I was not able to solve the other problem (toggling LEDs with MIDI note on/off messages), which is rather more important to me now - I don’t think they are related. To sum it up: toggling works in your [tt]midibox64e_v2_2[/tt] application, but not in mine. The
#define DEFAULT_DIN_SR_PIN_x
as well as
#define DEFAULT_DOUT_SR_PIN_
statements in [tt]setup_midibox_mf.asm[/tt] and [tt]main.asm[/tt] respectively are the same. The [tt]mb64e_leds.inc[/tt] files are identical for both. [tt]mb64e_presets.inc[/tt] is almost identical, except for a portion at the end of my file, which does not exist in yours:
org 0x07400 ; enc strings
MB64E_Presets_FLASH_Upper
MB64E_Presets_OffsetLabels
#define ENC_LABEL_MODE_HEX 0x40
#define ENC_LABEL_MODE_PM_HEX 0x41
#define ENC_LABEL_MODE_DEC 0x42
#define ENC_LABEL_MODE_PM_DEC 0x43
#define ENC_LABEL_MODE_HEX_B 0x60
#define ENC_LABEL_MODE_PM_HEX_B 0x61
#define ENC_LABEL_MODE_DEC_B 0x62
#define ENC_LABEL_MODE_PM_DEC_B 0x63
;; <---------------> mode
ENC_LABEL_ENTRY "Volume # 1 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 2 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 3 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 4 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 5 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 6 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 7 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 8 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume # 9 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #10 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #11 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #12 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #13 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #14 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #15 ", ENC_LABEL_MODE_DEC_B
ENC_LABEL_ENTRY "Volume #16 ", ENC_LABEL_MODE_DEC_B
...
I don’t think this actually matters, or does it? [tt]mb64e_midi.inc[/tt] is the second last file that has differences: while in the original application the [tt]MB64E_MIDI_NotifyReceivedEvent[/tt] looks like
MB64E_MIDI_NotifyReceivedEvent
;; branch to MIDI learn handler if enabled
IFSET MB_STAT, MB_STAT_LEARN_MODE, goto CS_M_LEARN_NotifyReceivedEvent
;; if RECEIVE_PC_FOR_BCHNGE flag is set, check if channel matches and switch bank in this case
SET_BSR MB64E_BASE
BIFCLR MB64E_CFG1, MB64E_CFG1_RECEIVE_PC_FOR_BCHNGE, BANKED, rgoto MB64E_MIDI_NotifyReceivedEventNP
MB64E_MIDI_NotifyReceivedEventPC
;; compare with expected program change for bank changes
movlw 0xc0 | ((DEFAULT_BANK_PRG_CHNG_CHANNEL-1) & 0xf)
xorwf MIOS_PARAMETER1, W
bnz MB64E_MIDI_NotifyReceivedEventNB
;; change bank
movf MIOS_PARAMETER2, W
call MB64E_BANK_Change
MB64E_MIDI_NotifyReceivedEventNB
;; compare with expected program change for patch changes
movlw 0xc0 | ((DEFAULT_PATCH_PRG_CHNG_CHANNEL-1) & 0xf)
xorwf MIOS_PARAMETER1, W
bnz MB64E_MIDI_NotifyReceivedEventNP
;; change patch
movf MIOS_PARAMETER2, W
call MB64E_PATCH_Change
MB64E_MIDI_NotifyReceivedEventNP
MB64E_MIDI_NotifyReceivedEvntNPC
;; branch to MIDI event scanner
rgoto MB64E_MIDI_Scan
in my application it is modified like this:
;; branch to MIDI learn handler if enabled
IFSET MB_STAT, MB_STAT_LEARN_MODE, goto CS_M_LEARN_NotifyReceivedEvent
;; if RECEIVE_PC_FOR_BCHNGE flag is set, check if channel matches and switch bank in this case
SET_BSR MB64E_BASE
BIFCLR MB64E_CFG1, MB64E_CFG1_RECEIVE_PC_FOR_BCHNGE, BANKED, rgoto MB64E_MIDI_NotifyReceivedEventNP
MB64E_MIDI_NotifyReceivedEventPC
;; compare with expected program change
movlw 0xc0 | ((DEFAULT_PROGRAM_CHNG_CHANNEL-1) & 0xf)
xorwf MIOS_PARAMETER1, W
bnz MB64E_MIDI_NotifyReceivedEventNP
;; change bank
movf MIOS_PARAMETER2, W
call MB64E_BANK_Change
MB64E_MIDI_NotifyReceivedEventNP
;; branch to MIDI event scanner
rgoto MB64E_MIDI_Scan
I wouldn’t suspect this change to be of any importance to the toggling LED problem either… The only other file with apparent differences is [tt]mios_tables.inc[/tt]. Mine looks like this:
MIOS_MPROC_EVENT_TABLE
;; entry 0x00-0x0f
MT_ENTRY 0xb0, 0x15 ;; Fader 1
MT_ENTRY 0xb0, 0x16
MT_ENTRY 0xb0, 0x17
MT_ENTRY 0xb0, 0x18
MT_ENTRY 0xb0, 0x19
MT_ENTRY 0xb0, 0x1a
MT_ENTRY 0xb0, 0x1b
MT_ENTRY 0xb0, 0x1c ;; Fader 8
MT_ENTRY 0x90, 0x3c
MT_ENTRY 0x90, 0x3d
MT_ENTRY 0x90, 0x3e
MT_ENTRY 0x90, 0x3f ;; Button8
MT_ENTRY 0x90, 0x40 ;; Button 1
MT_ENTRY 0x90, 0x41
MT_ENTRY 0x90, 0x42
MT_ENTRY 0x90, 0x43
;; entry 0x10-0x1f
MT_ENTRY 0x90, 0x44 ;; Button 9
MT_ENTRY 0x90, 0x45
MT_ENTRY 0x90, 0x46
MT_ENTRY 0x90, 0x47 ;; Button 12
MT_EOT ;; the last two buttons dont have LEDs!
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
MT_EOT
...
Also here I think there is nothing wrong!??
Actually, I am really out of clues… I compared the include files a number of times using a file compare tool, so I am rather sure that there are no differences. Is there anything else I should check? Any other functions which are involved in the process of toggling LEDs via MIDI note on/off messages? ???
Thanks, ilmenator