Skip to content

Microprocessors and Microcontroller programming in Assembly, C, and C++

Notifications You must be signed in to change notification settings

wasifijaz/Microprocessors_Interface_Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microprocessors and Interface Programming

Objectives

Microprocessor and Microcontroller PIC16F877a Programming using C, C++ and Assembly

Lab 1

Introduction of Micro-C, Proteus and PIC16f877 Microcontroller

Task 1:

Turn on each LED of PortD after one Second for one Second.

Task 2:

A door sensor is connected to pin 1 of PortB, and LED is connected to pin 7 of PortD. Write a code for PIC in C which monitors the door and turns on LED when door is open.

Lab 2

PIC16f877 Microcontroller Interrupts Programming

Task 1:

Write a code that performs two operations OP1 and OP2. OP1 will run continuously while OP2 will run only when external interrupt will appear.

OP1: PD7, PD6, PD5 will blink simultaneously after every second

OP2: PD4, PD3, PD2 will roll once and move back to OP1

Task 2:

Using RB port change perform the following operations.

OP1: Blink the LEDs attached to port D (RD0 – RD3) continuously.

OP2: LEDs attached to port D pins RD4 – RD7 should only turn on in such a manner as to display which bit of RB port change has changed its state.

Lab 3

Seven Segment Display using 16F877 Microcontroller

Task 1:

Take last four(4) digits of your roll number and display them on Seven Segment.

Lab 4

2-Dimensional Key-Pad interface using PIC16F877 Microcontroller

Task 1

2-Dimensional Key-Pad interface using PIC16F877 Microcontroller

Lab 5

LCD interfacing with PIC16F877A

Task 1

Display your name and roll number on the lcd

Lab 6

Introduction to Assembly Language and Addressing modes of 8086/8088 processor

Task 1

Write an assembly code to read and write “1234h” in DS. Using addressing modes mentioned below

  • Direct addressing mode
  • Register indirect addressing mode
  • Indexed addressing mode
  • Based indexed plus displacement addressing mode

Lab 7

8086/8088 Arithmetic Instructions

Task 1

Calculate the following expression in the emulator

[(ab)+(cd)]/e

For a=5, b=2, c=2, d=2 and e=7

Task 2

Calculate the same expression as mentioned in task 1 but this time take values from the user and display the result on the emulator screen.

Lab 9

8086 Logical Instructions

Task 1

Multiply decimal 14 with decimal 14 using Add and Shift operators.

Lab 10

8086/8088 Program Flow Control

Task 1

Take a 16-but integer from the user and find out whether a number is even or odd and display on the screen.

Lab 11

8086/8088 Program Flow Control II

Task 1

Initialize an array with 10 elements and calculate its average using loop instruction. Make a seperate subroutine that must be called from main function and display the result on screen.

Lab 12

8086 Logic Instructions Flow

Task 1

Take marks of subject as an input from the user and display the grade on screen.

Task 2

Compare the contents of two arrays and display whether arrays are equal or not. Use subroutine to write the comparison.

Task 3

Calculate the dot product of two arrays using loop instruction.

Task 4

Using loops read a string, character by character from the user and display it on screen similarly.

Lab 13

Timer Lab

Task 1

Write a program that uses Timer1 to generate a square wave on PORTD.5, while at the same time transfers data from PORTC to PORTB.

Task 2

Assume that clock pulses are fed into the TICK1 pin and an alram led is connected on PORTB.0. Write a program for counter 1 to power up the alarm led after every 100 pulses.

Lab 14

ADC using PIC16F877 Microcontroller

Task 1

Modify the code in lab so that ADC can be used to turn on an LED when ADC input voltage is greater than 2.5 volts and turns off when when voltage falls below 2.5V.

Lab 15

Stepper Motor Control using PIC16F877 Microcontroller

Task 1

Modify this code such that stepper motor starts rotating like a DC motor.

About

Microprocessors and Microcontroller programming in Assembly, C, and C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published