Professional Documents
Culture Documents
EE366 - Microprocessors and Microcontrollers: PIC 18 Microcontroller Architecture, Simulation and Assembly (Part 2)
EE366 - Microprocessors and Microcontrollers: PIC 18 Microcontroller Architecture, Simulation and Assembly (Part 2)
Faculty of Engineering
Electrical-Computer Engineering Department
Section
EAG
Lab Time
Wednesday, 14:00–15:50
Submission Date
Team Members
Instructors
Dr Rania Elmanfalouty
Engineer Hanin Almaghrabi
Table of Contents
Introduction................................................................................................................................3
Objectives...................................................................................................................................3
Experiment.................................................................................................................................3
Schematic Diagram................................................................................................................3
Source Code...........................................................................................................................3
Results........................................................................................................................................3
Conclusion..................................................................................................................................3
Introduction
Microcontrollers are programmed using assembly language to execute control commands for
various devices (lighting an LED) or to read device (sensor) data. This data is transferred
using IO ports or pins which can be calibrated to either digital or analog. In this lab, the rotate
feature is to be programmed and tested to rotate the LEDs and alternate the direction of
rotation with a varied time delay to regulate the speed of rotation. The outcomes of this lab
work is to enhance programming skills using MPLAB IDE and get more familiarized with
the different modules and registers (ADC) of the microcontroller.
Objectives
To gain an understanding of switch debouncing
To gain an understanding of Branch and time delay loops
To gain an understanding of Analog to Digital Convertor module
Software:
MPLAB X IDE
Experiment
Schematic Diagram
Source Code
Results
Conclusion
To conclude, the outcomes of the lab were successfully met. Some of the tasks completed
were tested visually on the Dwengo board. These tasks include configuring IO pins and the
ADC module, rotating latch register in both directions each time to display rotating lights
emitting from a set of LEDs and programming a time delay on a switch/button to toggle the
state of the LEDs. In order to control the speed of rotation, a Potentiometer has been
programmed and connected to the Dwengo board; displaying a successful test. Other than the
LEDs, some useful applications of these features include controlling the rotation of motor
shafts and developing interfaced games.