background image

 

AVR350

 

 

3

1472D-AVR-01/08 

5 Receiver Considerations  

This protocol NACKs the following conditions: 

1. Framing error on any byte 

2. OverRun error on any byte 

3. CRC error 

4. Receiver timed out (didn't receive packet within one second) 

On any NACK, the sender will re-transmit the last packet. Items one and two should 
be considered serious hardware failures. Verify that sender and receiver are using the 
samebaud rate, start bits and stop bits. Item three is found in noisy environments, and 
the last issue should be self-correcting after the receiver NACKs the sender. 

6 Data Flow Diagram  

The data flow diagram below simulates a 5-packet file being sent. 

Table 6-1. 

Data Flow Diagram 

Sender  

Receiver 

 <--- 

“C” 

 

 

Times Out after Three Seconds

 

 <--- 

“C” 

SOH 0x01 0xFE Data CRC ---> 

Packet 

OK 

 <--- 

ACK 

SOH  

0x02 

0xFD  

Data  

CRC 

---> 

(Line Hit during Data Transmission) 

 <--- 

NACK 

SOH  

0x02 

0xFD  

Data  

CRC 

---> 

Packet OK 

 <--- 

ACK 

SOH  

0x03 

0xFC  

Data  

CRC 

---> 

Packet OK 

(ACK Gets Garbled) 

<--- 

ACK 

SOH  

0x03 

0xFC  

Data  

CRC 

---> 

Duplicate Packet 

 <--- 

ACK 

SOH  

0x04 

0xFB  

Data  

CRC 

---> 

(UART Framing Error on Any Byte) 

 <--- 

NACK 

SOH  

0x04 

0xFB  

Data  

CRC 

---> 

Packet OK 

 <--- 

ACK 

SOH  

0x05 

0xFA  

Data  

CRC 

---> 

(UART Overrun Error on Any Byte) 

 <--- 

NACK 

SOH  

0x05 

0xFA  

Data  

CRC 

---> 

Packet OK 

 <--- 

ACK 

EOT ---> 

Packet 

OK 

(ACK Gets Garbled) 

<--- 

ACK 

EOT ---> 

Packet 

OK 

Finished <--- 

ACK 

Summary of Contents for AVR AVR350

Page 1: ...s than 1K Bytes of Code Space C High level Language Code 1 Introduction The Xmodem protocol was created years ago as a simple means of having two computers talk to each other With its half duplex mode...

Page 2: ...132 133 Start of Header Packet Number Packet Number Packet Data 16 bit CRC 3 Definitions The following defines are used for protocol flow control Table 3 1 Protocol Flow Control Symbol Description Val...

Page 3: ...self correcting after the receiver NACKs the sender 6 Data Flow Diagram The data flow diagram below simulates a 5 packet file being sent Table 6 1 Data Flow Diagram Sender Receiver C Times Out after T...

Page 4: ...scillator This is sufficiently accurate at room temperature for operation up to 38 4K Baud For higher Baud rates the on board 3 6864MHz oscillator or a 7 3728 MHz crystal should be used with the init...

Page 5: ...9 3 recv_wait c initialize timer1 counter for a 1 second delay wait till buffer is full or timeout 9 4 respond c clear error flags If packet was good or end of transmission then Send an ACK Else Purge...

Page 6: ...cond character in buffer plus the third character in buffer 0xff then compute CRC on packet data if CRC ok then increment packet number packet good else packet bad else bad packet number checksum else...

Page 7: ...ARRANTY RELATING TO ITS PRODUCTS INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIR...

Reviews: