Maxeyas
Junior Member level 3
Hello edaboard forums. I wasn't sure where to post this and hopefully if this is the wrong section an administrator will move this thread to the right place.
To the point.
I'm trying to initialize and lcd and write data to it (displaying chacters). I'm using alot of connection to desired port and therefore decided to use an electronic chip named 74hc138 which accourding to certian code it will adress the correct device. I've decided to put the lcd on 0x6000. I'm initializing the lcd with the proper commands and send data, Burn the program & yet there is only one bar with black box's. This is the code:
Please help me getting my lcd work. Thanks, Max.
To the point.
I'm trying to initialize and lcd and write data to it (displaying chacters). I'm using alot of connection to desired port and therefore decided to use an electronic chip named 74hc138 which accourding to certian code it will adress the correct device. I've decided to put the lcd on 0x6000. I'm initializing the lcd with the proper commands and send data, Burn the program & yet there is only one bar with black box's. This is the code:
Code:
/*
« Smart Table Project »
Script Version: 0.1 Alpha
Porgram Development: Kiel uVision, Assembly Assets.
Programmers_ Maxim 'Maxeyas' Zemlyansky
Dor 'Dor7539' Istrick • General Developers •
Moderator_ Afik Gilboa • Developers Moderator •
This script is private and is part of diploma project.
Nobody may edit/adjust this script without developers premission!
*/
// LCD - Main, Decoder Y3 - (011)16 = 6000H
// Data
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 getting my lcd work. Thanks, Max.