Jump to content

Use of Bankstick with 64k EEPROM


Recommended Posts

I need to store on a permanent basis about 200 sysex files.  About a half of these sysex files are just over 1028 bytes, there is a large "Reset" file of 11020 bytes,  there are two "tremelo" files of 2756 bytes and the rest are under 690 bytes.  The MIOS sysex implementation indicates that it is necesssary to insert a delay of 750mS between write blocks of 1028 bytes.

The relatively long write cycles will present no problem as the write transfers will be "offline".

The "Reset" sysex will be read on switch on only and the other sysex files will be read during the performance.  I note that

"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.

I am about to build an eight EEPROM bankstick module using the 24LC512.  I am assuming that it will be exactly the same  construction as for the 32K version.

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.

Regards Robin

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...