TOPICS TO COVER TODAY
1. Quick Revision
2. ATmega 32 : I/O Ports and Programming
1
2
3
TOPICS TO COVER TODAY
1. Quick Revision
2. ATmega 32 : I/O Ports and Programming
4
5
Application
Programs
Packed BCD Checksum Binary to
to ASCII byte ASCII
6
Checksum byte
Like parity generator, this ensure data
integrity in ROM.
It is extra byte added at the end of series of
data byte.
7
Checksum byte
Steps to generate checksum byte
1. Add byte together and neglect carries
2. Take 2s complement of the total sum.
To perform checksum operation, add all
bytes including the checksum byte. The
answer must be zero.
8
Checksum byte
Assume that we have 4 bytes of hexadecimal
data: 25H, 62H, 3FH, and 52H.
(a) Find the checksum byte,
(b) perform the checksum operation to ensure
data integrity, and
(c) if the second byte 62H has been changed
to 22H, show how checksum detects the
error
9
Checksum byte
10
Question..
Write an AVR C program to calculate Checksum Byte
for Hex numbers 0x25, 0x62, 0x3F and 0x52.
.
11
12
13