0% found this document useful (0 votes)
63 views

Laboratory 1 Name: - : Embedded and Realtime Systems

This document provides instructions for a laboratory exercise involving an embedded system with a PIC16F877 microcontroller. Students are asked to: 1) Outline the program design using pseudo code to control the LED outputs based on the switch inputs as defined in a table. 2) Identify the special function registers needed and their bit configurations. 3) Write the C program using MPLAB, including comments and titles. 4) Verify the program functionality using MPLAB simulation and document the process. 5) Download the program to a PICDEM2 board and verify it works as intended.

Uploaded by

anthohoran
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Laboratory 1 Name: - : Embedded and Realtime Systems

This document provides instructions for a laboratory exercise involving an embedded system with a PIC16F877 microcontroller. Students are asked to: 1) Outline the program design using pseudo code to control the LED outputs based on the switch inputs as defined in a table. 2) Identify the special function registers needed and their bit configurations. 3) Write the C program using MPLAB, including comments and titles. 4) Verify the program functionality using MPLAB simulation and document the process. 5) Download the program to a PICDEM2 board and verify it works as intended.

Uploaded by

anthohoran
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Dept.

of Electronic Engineering

EE302 John Maloco

Embedded and Realtime Systems

Laboratory 1
INSTRUCTIONS

Name:____________________

This laboratory should be completed within the 3 hours allocated and handed up at the end of the lab. Be sure to include your name on all your work. Parts 1, 2, 4 and 5 of the Laboratory exercise should be answered in the space provided. Be sure to include a printout of your source code with your answers. Dont forget to include your name. Copying will be penalised DETAILS Figure 1 below depicts a basic configuration of an embedded system based around the PIC16F877. The circuit consists of the following: Fosc : SW1 : SW2 : LED1 : LED2 : Vdd
1
MCLR Vdd

4 Mhz Switch 1 Switch 2 LED 1 LED 2 5V


20
15pF OSC1

9
4 Mhz Xtal

SW 1 22 SW 2 23

PIC16F877
OSC2 RB0 RB1 RA4 RB2 Vss Vss

10 17 16 R2 LED 1 R1

15pF

19

LED 2

Vss Figure 1 Note: Internal Pull-up resistors must be enabled on PORTB.

0V

Dept. of Electronic Engineering

EE302 John Maloco

Embedded and Realtime Systems The desired function of the circuit is given in Table 1.

SW1 1 1 0 0

SW2 1 0 1 0

LED1 On On Off Off Table 1

LED2 On Off On Off

Laboratory Exercise 1. Using Pseudo code, outline the design of the program for the above. (10 marks) 2. List the Special Function Registers associated with this program task and detail the bit configuration for each. (10 marks) 3. Using MPLAB create a project and write the C program for the above. Include good comments and a title section for your code. (35 marks) 4. Verify the function of the program using the MPLAB Simulator. Document your step by step verification procedure. (25 marks) 5. Download your program to the PICDEM 2 board and verify that your program works. (20 marks)

Notes: 1. The Sample Lab in the first Lab/Tutorial is very similar to this lab please refer back. 2. After creating a project in MPLAB ensure that the configuration bits are set either in the code or in MPLAB.

Dept. of Electronic Engineering

EE302 John Maloco

Embedded and Realtime Systems Answer to Laboratory Exercise 1

Answer to Laboratory Exercise 2

Dept. of Electronic Engineering

EE302 John Maloco

Embedded and Realtime Systems Answer to Laboratory Exercise 4

Answer to Laboratory Exercise 5 Show lab demonstrator software working on PICDEM2 board. Lab demonstrator to sign off on this:

You might also like