background image

 

 

 

8-bit  

 

Microcontrollers 

 

Application Note 
 
 
 

Rev. 1472D-AVR-01/08 

 
 

AVR350: Xmodem CRC Receive Utility for AVR

®

Features 

• 

Programmable Baud Rate 

• 

Half Duplex  

• 

128-byte Data Packets  

• 

CRC Data Verification  

• 

Framing Error Detection  

• 

OverRun Detection  

• 

Less 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 of operation, 128-byte 
packets, ACK/NACK responses and CRC data checking, the Xmodem protocol has 
found its way into many applications. In fact most communication packages found 
in the PC today have a Xmodem protocol available to the user. 

 

 

 

Содержание AVR AVR350

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Отзывы: