Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
EE316 Homework Assignment-1

EE316 Homework Assignment-1

Ratings: (0)|Views: 11 |Likes:
Published by choloholo
Become seven engineers in one.
Become seven engineers in one.

More info:

Categories:Types, Research
Published by: choloholo on Jan 09, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/09/2013

pdf

text

original

 
EE316 Homework Assignment #1
(To be
Submitted
with
Exam #1
) Page 1 of 2
Part-1Problem-A
Draw
a
Schematic
by
Hand
and
Write Assembly Code
to accomplish the following
Task!
 Embedded Microcontroller:
PIC18F4550
1.) Properly connect a
SPDT Mechanical Switch
to
Bit-3 of Port-A
, such that, this switchcan be set to either a
Logical “1” (5v)
, or a
Logical “0” (0v)
.2.) Properly connect a
Red LED
to
Bit-2
of
Port-B
, and a
Yellow LED
to
Bit-1
of
Port-B.
 3.) According to
your Experiment Board Schematic
, properly connect a
20MHz Crystal
 and
Two
 
Capacitors
to the
PIC18F4550
microcontroller.4.) Properly connect the following controller pins for Normal Operation;
Vdd, Vss
, and
MClr,
 according to
your Experiment Board Schematic.
 
See Pages 3 & 7 of your Experiment Board Schematic for Help!See
the
PIC18F4550_Datasheet_Pages_of_InterestDocument Page 64
for help with
GeneralPurpose
&
Special Function Register Addresses
(Not the Same Addresses as in the Tutorial)!You may use
HS
or
HSPLL
and any
PreScale
and/or
PostScale Divide by Value,
with the20MHz Crystal, to produce the following
1 Second
&
2 Seconds
 
Result
.When the
Switch
at
Bit-3
of
Port-A
is set to a
Logical “1” (5v)
, the program will Loop until thisswitch is changed to a
Logical “0” (0v).
At this time, the
Yellow LED
is to be placed in the
On-state
for approximately
1 second
. Then, the
Yellow LED
is to be placed in the
Off-state
for
2 seconds
. This process is to be
Repeated 1 More time
. Next, the
Red LED
is to be placed inthe
On-state
for approximately
2 seconds
. Then, the
Red LED
is to be placed in the
Off-state
 for
1 second
. This process is to be
Repeated 1 More time
. After which, the
Entire Process
is
Repeated
as long as the
Switch
at
Bit-3
of
Port-A
is set to a
Logical “0” (0v)
. When the
Switch
 at
Bit-3
of
Port-A
is set to a
Logical “1” (5v)
, the Process is Halted until the
Switch
at
Bit-3
of
Port-A
is set to a
Logical “0” (0v)
, again. The
Loop
may be
Completed
before
Halting
theprocesses.
Please be sure to at least one subroutine!
Part-1Problem-B
Also,
Compute
the total
Execution Time
for the following code using a
20MHz Crystal,
at
 HSPLL
and a
PostScale CPUDIV
of
4
and a
PLL PreScale Divide by Value
of
5
.BSF 03h,5MOVLW 02hMOVWF 85hBCF 03h,5BSF 03h,5MOVLW 04hMOVWF 86hBCF 03h,5

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->