I'm using an FPGA (Xilinx Virtex-II Pro) with a power pc core build inside. I want to write a huge number of data from this device to Matlab on a computer through a serial (RS232) connection. Stdout is the output.
I'm using fwrite(&value,4,1,stdout) which works for all numbers except for 10 (or any other number with 00001010 in it).
for example:
int value = 5;
fwrite(&value,4,1,stdout);
gives: 0 0 0 5 = bytes in decimal form (which is what i expect)
but
int value = 10;
fwrite(&value,4,1,stdout);
gives: 0 0 0 13 10
It seems he mistakes the 10 as a new linefeed and outputs an extra carriage return in front of it? Is this normal and what or where can i solve this problem