MP Lab1 032
MP Lab1 032
Lab # 01
In-Lab
In-Lab Task 1: Arduino Learning Tutorial
Code:-
In This task We Simply Sketch a Light blink program Fusing Arduino Ide.The Code we Took
from examples Which Is stored In the Arduino
Explanation:-
We first time use AVR Microcontroller and found the different Simulation Option
either To Do Code using C language Or By Assembler. First Time There Was
diffuculty To Find The Hex File But Learned And Remembered It.Press F7 button to
build output files of the project including object file and hex file.
C-Code:
/*This code will configure Port B for output and then toggle Port B
pin 3 with a delay of 1000ms*/
main()
SIMULATION :-
We know Which Controller we will use and In our next labs On which
controller We will Performs Task Also We Specify That The controller
In Arduino Is Atmega328P Every Time We will select This when We
Rum AVR controller Foe Our Code
SIMULATIONS OR Method :
Figure 1.10 – How to create new project using Microchip Studio installed in Lab
Figure 1.11 – Compiler selection and Project name description with location
1. In the Device Selection window, select ATmega328P. Click OK to create the
project as shown in figure 1.12.
In Lab Task 4:
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, ….. 100).
Explanation :-
We simply write code in which we get Output On port B which is fabnonacci series
Number We display.
CODE:
Proteous work :
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.
In This code there were error Given in it we Removed Them ans Simply Run the Pro
c. The following code is written to generate fibonacci series output at PortB which
is given as (0, 1, 2, 3, 5, 8, .
Proteus Simulation :-
As We Give Input in code Same We Can see Turn On the lights In Protesus
This Lab WS Our Introductory Lab And We Little Bit performed Simple tasks
The First Software Is AVR Microcontroller which is easy To use if we Know C
language Simply We can Make logics And Can Type Code By self AVR we get
A lot Options Of Different Micro Controller Chips but Our Required is
Atmega328P In which We Perform Our Next labs. The Second one Is Proteus
We already Used It has library And Which thing We Need We simply Search in
it E.g. We Need Controller We search Astmega328P and Resistor and connect
Them Through Wire But New Thing Is HEX File Which Connect AVR With
PROTEUS SIMULATIONS IN background We Change AVR code it Will
Affect On Proteus Simulations
Lab Assessment
Pre Lab /1
In Lab /5
Post Lab Data /4
Analysis
Data /4 /4
/10
Presentation
Writing Style /4