Write an ALP to read port 2 and write to port1 of 8051 micro controller.
Aim:
Write an ALP to read port 2 and write to port1 of 8051 micro controller.
Apparatus/software:
1. 8051 microcontrollerkit /keil evaluation version/sdcc —1 2. C.R.O 3. Connecting wires. --1
Algorithm:
Step1: Write 0FF hex to make port2 as input port.
Step2: Read port 2 into reg A
Step3: complement regA
Step3: Write reg A to port1
Step4: Repeat step 2 to step3
Program:
MOV A, #0FFH ;A=FF hex MOV P 2, A ;make P0 an i/p port by writing it all 1s BACK: MOV A, P2 ;get data from P2 CPL A MOV P0, A ;send it to port 1 SJMP BACK ;keep doing it
Procedure:
1. Compile the program in keil compiler. 2. Down load program into micro controller. 3. set input in port 2 4. verify output in port 1
Expected results:
The values set to port 2 are read and send to port1.
Hex file generated:
:0B00000074FFF5A0E5A0F4F59080F976 :00000001FF
Result:
Viva-voce questions:
1) How many no. of ports available for 8051? 2) Which instructions are used for reading & writing data from/to ports of 8051? 3) What is an ISR and IVT? 4) What is the difference between software and hardware interrupt? 5) What is the vector address for serial communication interrupt?
-
UpdatedOct 23, 2014
-
Views9,407
Write and execute an alp to 8086 Microprocessor to add, subtract and multiply two 16 bit unsigned numbers. Store the result in extra segment
Write and execute an alp to 8086 Microprocessor to a sort the give array of 32 bit number in ascending and descending order.
Program to generate following waveforms
- Ramp waveform
- Square waveform
- Step waveform
- Triangle waveform
Write and execute an alp to 8086 Microprocessor to find the length of a given string which terminates with a special character
Write and execute an alp to 8086 Microprocessor to divide a 32 bit unsigned numbers by a 16 bit unsigned number. Store the result in stack segment
Interface a stepper motor to 8086 and operate it in clock wise and anticlockwise by choosing variable stepsize.