Professional Documents
Culture Documents
Name
Registration
Number
SOFTWARES USED
Arduino
Atmel Studio (Version 7)
AVR Studio (Version 4)
Proteus ISIS
WinAVR (Version 2010)
PRE-LAB
Get the following software installers from MP/VLSI lab and install them in your laptops. The
same software will be available in the Lab PCs.
Arduino:
Arduino is an open-source platform used for building electronics projects. It consists of both a
physical programmable circuit board and an IDE (Integrated Development Environment) that
runs on your computer. Most Arduino boards consist of an Atmel 8-bit AVR microcontroller
with varying amounts of flash memory, pins and features. Arduino is programmed using the
Arduino Software (IDE) which is a cross-platform application for windows, macOS and Linux.
It is connected to a PC via USB cable to upload computer code to the physical board. This also
provides power to the board, as indicated by a LED.
AVR Studio:
AVR Studio is an Integrated Development Environment (IDE) used to develop projects
(software part) for AVR microcontrollers. This IDE consists of a project management tool,
source filer editor, assembler and front-end for C/C++ programming, a debugger and a hardware
(MCU registers) Simulator. With AVR Studio, you can develop code in C as well as in
Assembly Language. Both approaches are different from each other. Each has its own merits as
you will learn during the coursework.
Atmel Studio:
Atmel Studio 7 is the integrated development platform (IDP) for developing and debugging
Atmel Atmel AVR microcontroller (MCU) applications. Atmel Studio 7 supports all AVR
MCUs. It gives you a seamless and easy-to-use environment to write, build and debug your
applications written in C/C++ or assembly code. It also connects seamlessly to Atmel debuggers
and development kits.
WinAVR
WinAVR is a suite of executable, open source software development tools for the Atmel AVR
series of microprocessors hosted on the Windows platform. It includes the GNU GCC compiler
for C and C++. You will install this software (release 2010) on your PC/Laptop and it will be
used to compile your C/C++ code for the AVR microcontroller. IDEs such as AVR Studio will
automatically detect and use WinAVR installation and you will not need to run this software
yourself.
Proteus
The Proteus Design Suite is a complete software solution for circuit simulation and PCB
design.Proteus can simulate electric/electronic and microcontroller based circuits. It supports
number of microcontrollers available in the market.
ATmega 328p
The Atmel AVR ATmega328P is a low-power 8-bit microcontroller architecture.It has 131
Powerful Instructions. Most of them require single clock cycle for execution. It has 32K bytes of
In-System Programmable Flash Program memory with Read-While-Write capabilities, 1K bytes
EEPROM, 2K bytes SRAM, 23 general purpose I/O pins and 32 general purpose working
registers.
ATmega 328P Peripheral Features
3 flexible Timer/Counters with compare modes
Six PWM Channels
Internal and External Interrupts
A serial programmable USART
Two Master/Slave SPI Serial Interface
8 channel 10-bit ADC.
Where x is the port B, C or D. All these registers are 8-bit registers. Figure 1.1 shows the three
registers associated with Port B.
Pin configuration of ATmega 328P can be seen in Figure 1.1.
IN LAB-TASKS:
a. The following code is written to generate fibonacci series output at PortB which is given
as (0, 1, 2, 3, 5, 8, 13, 21, 34, 55).
b. Build the following code in AVR Studio or Atmel Studio. Read the error messages,
identify and correct any syntax errors and rebuild the solution.
c. Use Debugging mode of AVR Studio or Atmel Studio to debug and correct the code to
get the desired output. In debug mode, open watch window to check the value of the
variables.
Code:
//This code will generate Fibonacci series.
#include /*This header file includes the appropriate I/O definitions for the device */
#define F_CPU 16000000UL //XTAL Frequency =16MHz
#include /*This header file is required for generating delays*/
int main(void)
{ DDRB = 0b11111111 //Configure Port B as Output
int t1 = 1, t2 = 1, nextTerm = 0, i = 1;
while (i < 10)
{ PORTB = nextTerm; //Generate fibanocci series
nextTerm = t1 - t2;
t1 = t2;
t2 = nextTerm;
i = i + 1; }
while (1)
{
}
return 0; }