background image

 

AVR350 

1472D-AVR-01/08 

9.7 validate_packet.c 

if not timed out then 

if no uart framing or overrun errors then 

if first character in buffer is SOH then 

if second character in buffer is the next packet number 

then 

if second 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 

duplicate packet number 

else 

if first character in buffer is EOT then 

end of transmission 

else 

at least 1 byte had a framing or overrun error, packet is bad 

else 

timed-out without receiving all characters, packet is bad 

 

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: