Lab Experiment 10
Lab Experiment 10
Lab Experiment 10
Lab Experiment#10
Objective: To become familiar with MAX7221 IC and its programming using AVR
Microcontrollers via SPI protocol.
MAX7221 IC:
In many applications you need to connect two or more 7 segment LEDs
to a microcontroller. For example if you want to connect four 7 segment
LEDs directly to a microcontroller you need 4x8=32 pins. This is not
feasible. The MAX 7221 IC is an ideal chip for such applications since
it supports upto 8 7- segment LEDs. We can connect the MAX 7221 to
the AVR chip using SPI protocol and control upto 8 7- segment LEDs.
The MAX7221 contains an internal decoder that can be used to convert
binary numbers to 7 segment codes. The device includes analog and
digital brightness control, an 8x8 static RAM that stores each digit, and
a test mode that forces all LEDs On.
Lab Experiment#10
#include <avr/io.h>
# define MOSI 5
# define SCK 7
# define SS 4
void execute( unsigned char cmd, unsigned char data)
{
DEPARTMENT OF ELECTRICAL ENGINEERING
MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO
Lab Experiment#10
Lab Tasks:
Write an AVR program, to display EL on the two digits of the 7-segment.
Simulate an AVR program on Proteus which shows counting from 1 to 9.
Configure AVR in master mode sending letter A continuously and observe the packet on SPI
Debugger.
Attach the snapshots for the simulation results of all the tasks.