project on microchip

profileibrahim93
project1.docx

Embedded Systems Lab Eng. Sara Mahmoud

Z:\Digital\logo_1.png.330x170_q85_crop-50x50.png

AMERICAN UNIVERSITY OF THE MIDDLE EAST COLLEGE OF ENGINEERING

ECE/CE-362- Embedded Systems LAB

PROJECT QUESTION (1)

DATE: 2-6/03/2014

DUE DATE: 9-13/03/2014

1. Architecture

Design and implement a system that reads two values from two motors connected to two pins on a port, and based on their input values different actions should be carried out. The values from the two devices are digital inputs. For example, if the values read are ‘00’ on pins 0 and 1 then subroutine corresponding to that input should be executed. Design your program so that it continuously reads the values on the chosen input pins. Program this system using Assembly Language and the MPASM assembler/complier. Use the PIC16F877A microcontroller for this system running on a crystal frequency of 4MHz. Draw the corresponding circuit for this system on Proteus 8.0 and download the program once on this software and another time on the BK200+ board.

2. Implementation

Write a program that reads two digital inputs from two motors connected to Port B on pins RB.0 and RB.1. If the values of these two inputs are both zero then your program should call the subroutine described in Table 1. If the values are 01 instead then your program should call the other subroutine described below. Your program should be written and designed so that you have at least three subroutines. Two of them are executed based on the input values from Port B and the third is a Delay subroutine. Use the delay subroutine delay found below. On Proteus, use the motor component from the ACTIVE library (simple DC motor).

Table 1.

RB.1

RB.0

Subroutine

0

0

IOR(inclusive OR) two numbers and place their output on Port D.

0

1

Count up till the value 8 in decimal on PORT D.

Delay Subroutine:

movlw 0x3

movwf 112h

XXX: movlw 0x64

movwf 111h

XX: movlw 0x08

movwf 110h

X: decfsz 110h, f

goto X

decfsz 111h, f

goto XX

decfsz 112h, f

goto XXX

Design Steps:

· Write the Assembly program for this system.

· Draw the Proteus circuit for this system.

· Download the code on the BK200+ board.

· Write the project report.

3. Grading Policy:

Project Grading Policy

Program

30%

Proteus Circuit/ Board (BK200+) and Output

50%

Report

20%