Ok, preloading the BankStick isn’t that difficult, since MIOS provides an upload mechanism which is very similar to the flash/EEPROM upload. The data needs to be located to 0x400000 - and thats all 
Here an example. I’m using an assembler program, so that it is easier to locate data.
Filename: bs_1.asm
;; preload file for BankStick #1
list p=18f452
;; BankStick address range:
;; 32k BankStick (24LC256): 0x400000-0x407fff
;; 64k BankStick (24LC512): 0x400000-0x40ffff
org 0x400000
;; 16 bytes of data
db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
db 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
;; a string
db "This string is stored in BankStick!", 0x00
;; some words (16 bit)
dw 0xdead, 0xbeef
dw 0xaffe, 0xdead
;; another byte at a specific address
org 0x400400
db 0x12
;; DONT FORGET THE END!
END
[/code]
the .hex file can be created with following command:
gpasm bs_1.asm
Now you can upload bs_1.hex with MIOS Studio - the BankStick number (#1..#8) can be selected in the upload window.
Within the C program you can use the MIOS_BANKSTICK_Read(address) function to read from the BankStick.
With MIOS_BANKSTICK_Write(address, data) you can change the data, but note that a write takes 2 mS for each byte
The address range is 0x0000...0x7fff for a 32k BankStick, and 0x0000..0xffff for a 64k BankStick
If multiple BankSticks are connected to the core, the stick has to be selected with MIOS_BANKSTICK_CtrlSet(bs_number) before. bs_number range: 0..7
Example for printing a 16 character string, located at 0x0010-0x1f, from BankStick 3 (the 4th BankStick)
[code]
unsigned char i;
MIOS\_LCD\_CursorSet(0x00);
MIOS\_BANKSTICK\_CtrlSet(3);
for(i=0; i\<16; ++i)
MIOS\_LCD\_PrintChar(MIOS\_BANKSTICK\_Read(0x0010 + i));
For a faster load/store the MIOS_BANKSTICK_PageRead and MIOS_BANKSTICK_PageWrite functions are available, they handle 64 bytes at once. This is especially useful for writes (64 bytes are stored within 2 mS). However, when using these functions, you need a 64 byte buffer (an array of 64 “unsigned char”) which is located to an “aligned” address, means: 0x40, 0x80, 0xc0, 0x100, 0x140, 0x180, 0x1c0, 0x200, 0x240, 0x280, 0x2c0 - all other address ranges are already allocated by MIOS or the stack. So, in other words: using byte writes and reads is the easiest method. Best Regards, Thorsten.