ok but now im kind of weirded out. I don't know if my issue is coming from bad coding or mplab/HI-Tech C.
here's what's going on:
Code:
unsigned char rxdata;
unsigned char txdata;
txdata = 0b11110011; // set an arbitrary binizzel
rxdata = SSPBUF; // bring the binary from SDI
SSPBUF = txdata; // assign outgoing binary to buffer
//while (!BF); // cut for MPLAB Sim
unsigned char binarray[];
for( i = 0; i < 8; i++){
// using txdata for debugging, should be rxdata
binarray[i] = ( txdata >> i) & 1; // this line right here
}
Ok the strangeness is happening like this...
in the watch window, as I get into the for loop everything looks cool.
i == 0.
I hit the line of code with the >> in it and txdata becomes 0x01.
Subsequent loops: txdata stays 0x01, should stay 0xF3...
the watch window does not display binarray, it just says "" which I dont get either...
That code fails to compile for me. I had to change it to,
Code:
unsigned char rxdata,i;
unsigned char txdata;
unsigned char binarray[[COLOR="red"]8[/COLOR]];
txdata = 0b11110011; // set an arbitrary binizzel
rxdata = SSPBUF; // bring the binary from SDI
SSPBUF = txdata; // assign outgoing binary to buffer
for( i = 0; i < 8; i++){
// using txdata for debugging, should be rxdata
binarray[i] = ( txdata >> i) & 1; // this line right here
}