Professional Documents
Culture Documents
LAB 2
Handling individual bits on Atmega 32
Objectives
•Learning basics of Proteus
•Introduction to Atmega 32 processor
•Learning basics of Atmel studio
Tools Used
•Proteus 8.0
•Atmel Studio 7.0
BSCS 4-A Burhan Ahmed Satti 01-134172-065
/**
* \mainpage User Application template doxygen documentation
*
* \par Empty user application template
*
* Bare minimum empty user application template
*
* \par Content
*
* -# Include the ASF header files (through asf.h)
* -# "Insert system clock initialization code here" comment
* -# Minimal main function that starts with a call to board_init()
* -# "Insert application code here" comment
*
*/
/*
* Include header files for all drivers that have been imported from
* Atmel Software Framework (ASF).
*/
/*
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
*/
#include <asf.h>
board_init();
/* Insert application code here, after the board has been initialized. */
while (1)
{
if(PINB == 0x02)
PORTC = 0x80;
else
PORTC = 0x00;
}
return 1;
}
Result
Conclusion
The 7th pin lights up whenever there is input on 2nd port.