05-06-2013 08:53 AM
Hi there,
I was having trouble receiving SPI-messages. Checked the communication with a logic sniffer (everything as expected on the SPI-side) and I think I found the problem in the Arduino-code, function "spi_sendReceive".
After changing
...
Serial.print(SPI.transfer(command[i+6])); // this sends ASCII-characters
...
to
...
Serial.write(SPI.transfer(command[i+6])); // this sends raw hex-values
...
the correct data was sent to the PC. Am I messing something up here or was there really a bug in the code? Couldn't find any anything on the web about similar problems.
I'd be glad if someone could comment.
cheers
stefan
05-09-2013 02:57 AM
I believe you are correct. IIRC, I found this once before but was not able to test it personally.
05-09-2013 01:53 PM
Thank you!!! I did the same (Serial.write(SPI.transfer(command[i+6])); // this sends raw hex-values) & everything is all right now!!!