# Microcontroller writes additional data on high-frequent writes

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?

-
When you write 8 bytes, do those 8 bytes arrive at the PC correctly, then you receive 8x 119 ? –  Rocketmagnet Apr 21 '12 at 20:24
Yes, first the whole correct block, then the 8x119. –  Yogu Apr 21 '12 at 20:25
Do you have a logic analyser or an oscilloscope ? –  Rocketmagnet Apr 21 '12 at 20:27
Ok, I'll look at the oscilloscope graph. –  Yogu Apr 21 '12 at 20:30
Just send one byte, preferably something with a distinctive pattern, like the letter K –  Rocketmagnet Apr 21 '12 at 20:32