Microcontroller 8051

Microcontroller Practical
Whenever you have to enter the code press S and whenever you have execute the code press G.
In Code Statements
# <-- use to insert non pointer value . For moving this just use MOVE
@<-- similar to pointer value i.e @DPTR<==> *DPTR (in C language) .For moving this use MOVEX

There are two kinds of code that you write in 8085 Kit
1) Calculation Based --Like adding two 8/16 bit no. ,Multiplying 2 8 bit no. ,finding nibles,Even odd check

2) Fun Based --Like glowing LED...etc

In Calculation Based Code
You write code as
1)Stack pointer intialalization MOV SP,#58
2)DPTR initiallization for entering of data MOV DPTR,#6200
3)Moving DPTR pointer value data into accumulator MOV A,@DPTR
4)This Accumulator data will be stored in Backup register say R0 as alteration are made durring program in accumulator.
5) Increment DPTR to take next data

and Reapeat all 3),4),5) process in loop if more than two values are needed or when multipilication is done using ADD, SUB operator. using DJNZ  R2,LABEL(till not zero value of R2)

after this you can write 3 statements

LCALL 0610--store LCD display
LCALL 0502--display result
LCALL 0006--return to command window


Fun Based Program

Here you have ports like 90 --port P1
1)move data into PORT MOV 90,#AA
2)delay as otherwise eye not able to see difference ACALL 000D
repeat 1) with #55 data. and 2)
3)apply a loop But here using LJMP 6000 where 6000 is nothing but a LABEL

after that write this fix code for delay purposes ( I also Know why we write this)
MOV R1,#FF;
MOV R2,#FF;
LCALL 0114
RET                      --here it has OP CODE 22 not 76 as in microprocessor

Also here in microcontroller while writing opcode suppose you have 2000 then write OPCODE in normal sequence i.e 20 first then 00 But in microprocessor rule was opposite higher byte first.



                          






















































No comments:

Post a Comment