1. BIT OPERATION(SHIFT/ROTATE)
Aim: Write an AVR Assembly language program to implement rotating light
Procedure
1. Develop the program using AVR Studio, and build its hex file.
2. Burn the hex file into ATMega32 chip using eXtreme Burner software.
3. Observe the result
Program
;This program demonstrates rotating light
.include "m32def.inc"
.org 0
LDI R20, HIGH(RAMEND)
OUT SPH,R20
LDI R20, LOW(RAMEND)
OUT SPL,R20
LDI R16,0XFF
OUT DDRA,R16
AGAIN:
LDI R16,1 #FOR COUNT
LDI R17,8
LOOP1:
OUT PORTA,R16
CALL DELAY
LSL R16 # LOGICAL SHIFT LEFT
DEC R17
BRNE LOOP1
JMP AGAIN
DELAY:
LDI R18,82
D3: LDI R19,43
D2: LDI R20,0
D1: NOP
DEC R20
BRNE D1
DEC R19
BRNE D2
DEC R18
BRNE D3
RET
Result
The program has been developed and created hex code, the hex code is burned into the
microcontroller, and observed the working the embedded system.