Hello People,
I am starting a project (a portable medical datalogger) and have made some tries to determine what is better for doing this, PICBASIC or C18. In the process of acquiring the data from the amplifiers of the equipment (28 channels, 16 bit/sample, 128 sample/sec/channel) and posterior sending to a SD card I can not reach enough loading speed to the SD if I do not use two buffers of 512 bytes and flush them (one in the main body of the program while the other is being filled in a ISR basis). I started with PICBASIC PRO but early discovered that an erratic or unspected behaviour appear when I tried to address the 512 byte long arrays. So I split them in two 256 byte long sub-arrays and it worked. No need to say that this has made the code complicated and obscure. Is there some issue in PICBASIC PRO with the definitions of vars longer than a segment of 256 bytes? In C18 I had to redefine some bank boundaries to inform the linker that I had variables that jump from one bank to another. I feel more confortable programming in PICBASIC PRO because it isolates me from having to deal with delays, serial channels in non-hardware dedicated pins, etc, but the ¿poor? managing of big variables in PBP can stop me using it this time. The PIC is 18F4620 at 20Mhz, the ADc is a 7813 through SPI, the SD is loaded through a dedicated interface programmed in a chip (DosOnChip).
Has anybody used VARs longer than 256 bytes, for example:
BF1 VAR BYTE[512]
i VAR word
data VAR BYTE
//and then
data = BF1[i]
Thanks
Bookmarks