Hello Electronics point.
I'm trying to initialize an lcd with kiel uvision using assembler lang. Everything looks fine but when i burn the program to the atmel 89c5131a-ua the lcd only showing one bar with black box's.
Here is the code:
Please help me understand why this isn't working?
I'm trying to initialize an lcd with kiel uvision using assembler lang. Everything looks fine but when i burn the program to the atmel 89c5131a-ua the lcd only showing one bar with black box's.
Here is the code:
Code:
mov A, #38h // Function Set
lcall SendCommand
lcall Delay
lcall SendCommand
lcall Delay
lcall SendCommand
lcall Delay
mov A, #06h // Display Control
lcall SendCommand
lcall Delay
mov A, #0Eh // Entry mode set
lcall SendCommand
lcall Delay
mov A, #01h // Clears the display
lcall SendCommand
lcall Delay
mov A, #'M'
lcall SendData
lcall Delay
mov A, #'A'
lcall SendData
lcall Delay
mov A, #'X'
lcall SendData
lcall Delay
SendCommand:
mov DPTR, #6000h
clr P1.2 // Setting 0 in RS (0=commands,1=data)
movx @DPTR, A
setb P1.3 // Setting 1 in EN (disabling the lcd)
clr P1.3 // Setting 0 in EN (enabling the lcd)
ret
SendData:
mov DPTR, #6000h
setb P1.2 // Setting 1 in RS (0=commands,1=data)
movx @DPTR, A
setb P1.3 // Setting 1 in EN (disabling the lcd)
clr P1.3 // Setting 0 in EN (enabling the lcd)
ret
Delay: // 100x100 = 10000us = 10 ms
mov R7, #100
D1: mov R6, #100
djnz R6,$
djnz R7,D1
ret
end
Please help me understand why this isn't working?