Microprocessor and Microcontroller PIC16F877a Programming using C, C++ and Assembly
Turn on each LED of PortD after one Second for one Second.
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.
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
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.
Take last four(4) digits of your roll number and display them on Seven Segment.
2-Dimensional Key-Pad interface using PIC16F877 Microcontroller
Display your name and roll number on the lcd
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
Calculate the following expression in the emulator
[(ab)+(cd)]/e
For a=5, b=2, c=2, d=2 and e=7
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.
Multiply decimal 14 with decimal 14 using Add and Shift operators.
Take a 16-but integer from the user and find out whether a number is even or odd and display on the screen.
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.
Take marks of subject as an input from the user and display the grade on screen.
Compare the contents of two arrays and display whether arrays are equal or not. Use subroutine to write the comparison.
Calculate the dot product of two arrays using loop instruction.
Using loops read a string, character by character from the user and display it on screen similarly.
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.
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.
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.
Modify this code such that stepper motor starts rotating like a DC motor.