I'm using C-Control Pro 128 which contains a atmega processor. I've connected the rs232 interface with my PC and read the incoming data, having the following program executed on the controller:
void main(void) {
Serial_Init(0, SR_8BIT | SR_1STOP | SR_EVEN_PAR, SR_BD9600);
Serial_Write(0, 1);
Serial_Write(0, 2);
}
I'd expected the controller to output the bytes 1 and 2. Instead, I receive the following:
1
2
119
119
If I write e.g. eight bytes instead of two, 119 is appended eight times to the actual data. If I write only one byte, only the one byte is transmitted, so all works correct.
The number 119 is independend from the value of the bytes and from the baud rate.
If I add a sleep instruction between the write commands (about 50ms), the problem does not occur.
Has anyone had a similar problem or any idea where the problem could be located?