robinfawell Posted March 1, 2004 Report Share Posted March 1, 2004 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 Quote Link to comment Share on other sites More sharing options...
TK. Posted March 2, 2004 Report Share Posted March 2, 2004 I will move this posting to the MIOS board since this is not the right place for such questions Quote Link to comment Share on other sites More sharing options...
TK. Posted March 2, 2004 Report Share Posted March 2, 2004 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 abuffer overrun at the PC side (some MIDI interfaces cannothandle that much data). Another advantage is, that you are ableto record the SysEx blocks with a sequencer, you can store themin a midi file and playback to the MIOS core w/o takingcare for the required delays between the write cycles.But this has nothing to do with your application, since you haveto write your own SysEx sending routine anyhow (which isn't sodifficult). A BankStick read is always much faster than the transfer of a single MIDI byte. If you are searching forsome numbers: reading a single byte from BankStick takes about100 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 SysEximplementation.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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.