You are on page 1of 2

EE316 Homework Assignment #1

(To be Submitted with Exam #1)

Page 1 of 2

Part-1 Problem-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 switch can 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_Interest Document Page 64 for help with General Purpose & 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 the 20MHz 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 this switch 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 in the 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 the processes. Please be sure to at least one subroutine!

Part-1 Problem-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 MOVLW MOVWF BCF BSF MOVLW MOVWF BCF 03h,5 02h 85h 03h,5 03h,5 04h 86h 03h,5

EE316 Homework Assignment #1

(To be Submitted with Exam #1)

Page 2 of 2

Part-2 Problem-A
Embedded Microcontroller: PIC18F4550

Given that the 96 MHz PLL has a Fixed 1:24 Input-to-Output Frequency Ratio and that the Maximum Frequency of this PLL is 96MHz, Compute the Actual CPU System Clock Frequency, if a PLL PostScaler CPUDIV of 3 were selected with the following input conditions. Crystal Frequency = 12MHz PLL PreScaler Divide = 4

There is no mistake in this question. It requires you to think outside of the box.

Part-2 Problem-B
Assuming all of the above information, is it possible to use the USB Port, and if so, at what clock speed?

You might also like