Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views13 pages

Topics To Cover Today: Quick Revision Atmega 32: I/O Ports and Programming

The document discusses two topics to cover: quick revision and I/O ports and programming for the ATmega 32 microcontroller. It also provides an explanation of checksum bytes, including how they are generated by adding data bytes together and taking the 2's complement, and how they can be used to check for errors in transmitted data by ensuring the checksum equals zero. Examples are given of calculating the checksum byte for sample data and detecting an error if one of the bytes is changed.

Uploaded by

Mit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views13 pages

Topics To Cover Today: Quick Revision Atmega 32: I/O Ports and Programming

The document discusses two topics to cover: quick revision and I/O ports and programming for the ATmega 32 microcontroller. It also provides an explanation of checksum bytes, including how they are generated by adding data bytes together and taking the 2's complement, and how they can be used to check for errors in transmitted data by ensuring the checksum equals zero. Examples are given of calculating the checksum byte for sample data and detecting an error if one of the bytes is changed.

Uploaded by

Mit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

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

You might also like