Ich habe folgendes Programm fürs Senden:
1 | unsigned char write(uint16_t data){
|
2 |
|
3 | CLRSSLINE
|
4 | // Wait for empty transmit buffer.
|
5 | do {} while( (UCSR1A & (1<<UDRE1)) == 0 );
|
6 |
|
7 | // Send data.
|
8 | UDR1 = (uint8_t)(data>>8);
|
9 |
|
10 | // Wait for transfer to complete and return received value.
|
11 | do {} while( (UCSR1A & (1<<RXC1)) == 0 );
|
12 |
|
13 | // Wait for empty transmit buffer.
|
14 | do {} while( (UCSR1A & (1<<UDRE1)) == 0 );
|
15 |
|
16 | // Send data.
|
17 | UDR1 = (uint8_t)(data & 255);
|
18 |
|
19 | // Wait for transfer to complete and return received value.
|
20 | do {} while( (UCSR1A & (1<<RXC1)) == 0 );
|
21 |
|
22 | SETSSLINE
|
23 |
|
24 | return UDR1;
|
25 |
|
26 | }
|
Jetzt geht die gelbe SSLINE aber schon hoch, bevor das zweite Byte
geschrieben wurde. Wodurch kommt das?