Thanks for the response Bruce. I will try your example when I get to my bench later tonight.
For some reason I am having a hard time getting my head around how PBP handles arrays and formatting (DEC, STR, HEX, etc.)
Here is what I am attempting:
From VB using USB I pass 64 bytes of data that contain numbers in the range of 0-255
I assume this shows up in the PIC USBRXBuffer (var from DT and Mistere demos) in hex form of 0x00 through 0xFF.
For example,
PC side:Bufferout(2) = 150
Bufferout(3) = 200
Bufferout(4) = 8
.
.
.
Bufferout(63) = 233
On the PIC side the USBRXBuffer needs to be copied into another array, USBDataIn. I then use the data in USBDataIn to make program decisions and store some of the data in EEPROM.
If I use
Code:
ARRAYWRITE USBDataIn, [USBRXBuffer]
I get random data in the USBDataIn array. By random I mean I can not make the data look anything like the data sent from the PC. This would make sense since I never specified a length for the Arraywrite command.
If I use the for...next loop method then the data in USBDataIn matches what came from the PC.
If I try to do the
Code:
ARRAYWRITE USBDataIN, [STR USBRXBuffer\24]
the processor runs off into la la land. It looks like that method should work, so I guess I need to fire up the debugger and see where the code is getting lost.
So what would happen if you filled your array this way:
Code:
For I = 0 to 25
String1(I) = I * 10
Next I
So instead of having "ABCDE..." it now has (0,10, 20, 30...250)
Does the
Code:
' Copy String1 to String2
ARRAYWRITE String2, [STR String1\26]
produce an output of 0,10,20,30,40...250?
Bookmarks