Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Lab 3

LED Interfacing using MC-8600


Objective
To learn how to use LEDs and dipswitch on MC-8600 and interface using MikroC.

Equipment Required

● Microcontroller Training Unit

● RS-232 Cable

● Personal Computer

● Jumper Cables (03 pcs)


Procedure

● Connect the power cord to the MC-8600.

● Plug in AVR Atmega-32 microcontroller IC into ZIF Socket.

● Connect J1 with Programming port of microcontroller board by a jumper cable.

● Connect RS232 cable from PC to DB-9 of Programming port.

● Connect J2 to the Port A/0of the microcontroller.

● Turn on the training system and burn the hex file generated by the complier to the
microcontroller using AVR Dude Prog.
Introduction
Each port pin consists of three register bits i.e. DDxn, PORT xn and PIN xn.

Atmel AVR MEGA32 has four (04) ports.


1. PORTA
2. PORTB
3. PORTC
4. PORTD
Each port has 3 associated registers, corresponds to direction, port and input register.
Lab Tasks
Set delay time of your choice where not specified.
1) Write a program using MikroC, declare all the 4 ports of Atmel AVR ATMega32
microcontroller as output and turn LEDs on for 3 seconds and off for one second.

In this task we observe that all leds turned on for 3seconds and turned off for 1second we use
delay time for this purpose.
Connection:
Led array is connected to port like A j17 is connected to programming port and board is
connected to CPU and file is browse on the screen that appear.

2) A program is required to increment a value and then output to PORT A of the


microcontroller. Insert a delay in the program so the LED output can be seen visually.

In this program we use a counter to increment a led and time delay of 1ms and output result
displayed on PORT A , that showed next led glows after increment in previous led.
Connection: Led array is connected to port like A j17 is connected to programming port and
board is connected to CPU and file is browse on the screen that appear.
3) Write a program to turn on the LED’s connected to PORT A of the microcontroller in
sequence, resulting in a chasing LED effect. The data is displayed with about 1 second
delay between each output pattern.

In this task leds used delay of 1second to turn on the led which we want to turn on we give
address of that led .
Connection:
Led array is connected to port like A j17 is connected to programming port and board is
connected to CPU and file is browse on the screen that appear.

You might also like