Flowcharts By Zhi-Hern Loh

Home
Design
Results
A 2nd try
Schematics
Code
Files
Links
Contact

Back

This section contains flowcharts of the following:

bulletMain program
bulletXmodem reciever

Start Btn?

Start, Initialize interfaces, Display user prompts

N

Y

Initialize STA013 decoder, Initialize Xmodem receiver, Send Xmodem start character to Hyperterm

Volume change?

Playback

N

Y

File complete?

Change Volume

Y

N

Figure 1- Flowchart of main program

Send a ‘C’, Set Byte_Number = 1; Packet Number = 1;

Receive a byte

Check Byte#

Dump all received bytes for duration of 1 packet. Byte# = 1; Send NACK

Byte == SOT?

1

Byte == Packet#?

2

Byte == ~Packet#?

3

Write Byte to buffer

4 to 131

N

N

N

Y

Byte 132 = CRC high, byte 133 = CRC low. Calculate CRC

CRC ok?

Packet#++; Byte#=1; Send ACK

A

A

B

Byte#++

C

D

Figure 2 Xmodem recieve protocol (part A)

Note: Refer to the xmodem.h file for ascii values of SOT, EOT, CAN etc.

B

C

Byte == EOT?

EOT#==1?

EOT#++

Y

Y

Send NACK

D

N

Send ACK; File transfer successful.

N

Figure 3 - Xmodem receive protocol (part B)

The Xmodem receiver can cancel anytime by sending 2 CAN bytes.

 

 

 

 

Home | Design | Results | A 2nd try | Schematics | Code | Files | Links | Contact

For problems or questions regarding this web contact Zhi-Hern Loh.
Last updated: 05/02/02.