Hi Robin,
“If more than 1025 bytes are requested by the read command, MIOS will send multiple blocks and insert a delay between every block”
What is this delay? I am hoping that this will be small.
This is nothing for which you have to be worried about.
MIOS inserts these delays between the SysEx blocks to avoid a
buffer overrun at the PC side (some MIDI interfaces cannot
handle that much data). Another advantage is, that you are able
to record the SysEx blocks with a sequencer, you can store them
in a midi file and playback to the MIOS core w/o taking
care for the required delays between the write cycles.
But this has nothing to do with your application, since you have
to write your own SysEx sending routine anyhow (which isn’t so
difficult). A BankStick read is always much faster than the
transfer of a single MIDI byte. If you are searching for
some numbers: reading a single byte from BankStick takes about
100 uS in worst case (mostly ca. 50 uS). The transfer of a
MIDI byte takes exactly 320 uS.
How will the use of the 64k EEPROM alter the sysex
implementation? The reason I ask, is that I could use the
smaller EEPROM after reanalysing the total sysex requirement.
I have purchased the 64k EEPROM’s already.
Everything is in your hands, so it doesn’t alter the SysEx
implementation.
Here a small example:
;; sending a block of 11020 bytes which is stored at
;; address 0xa123 of the first BankStick
;; select first BankStick
movlw 0x00
call MIOS_BANKSTICK_CtrlSet
;; set start address to 0xa123
movlw 0xa123 & 0xff ; (low-byte)
movwf MIOS_PARAMETER1
movlw 0xa123 >> 8 ; (high-byte)
movwf MIOS_PARAMETER2
;; set loop counter, using TMP[12]
movlw 11020 & 0xff ; (low-byte)
movwf TMP1
movlw 11020 >> 8 ; (high-byte)
movwf TMP2
;; call the generic SYSEX_SendBlock routine which
;; can be found below
call SYSEX_SendBlock
;; and exit subroutine
return
;; generic SysEx send routine
;; Expects:
;; o BankStick address in MIOS_PARAMETER[12]
;; o number of bytes which should be sent in TMP[12]
;; o BankStick should be selected before with MIOS_BANKSTICK_CtrlSet
SYSEX_SendBlock
SYSEX_SendBlockLoop
;; since this routine runs longer than 1 second, the watchdog should
;; be serviced to avoid a reset --- use the clrwdt instruction only
;; on extreme long loops!
clrwdt
;; read from BankStick
call MIOS_BANKSTICK_Read
;; send value
call MIOS_MIDI_TxBufferPut
;; decrement 16-bit loop counter, loop until counter reaches zero
decf TMP1, F
skpc
decf TMP2, F
bc SYSEX_SendBlockLoop
;; thats all
return
This routine will take 320 uS * 11020 = ca. 3.5 seconds, limited by the MIDI transfer rate.
You could call this routine from a button handler…
Best Regards, Thorsten.