Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/22/03 17:25
Read: times


 
#53121 - it works now, but still some questions
Responding to: ???'s previous message
after two hours of changing it's now working, the result is an extra delay and some changes about the strobeing:

see the comments for my questions

#include 8051.H

ammo .equ 01h
hits .equ 02h

teller .equ 10h
temp .equ 11h

.org 0000h

MAIN acall LCDINIT
mov ammo,#255
mov hits,#0
acall LCDSTAT
LOOP sjmp LOOP

LCDSTAT ;here I write some text to the lcd
ret

LCDINIT setb P1.2
mov A,#56 ;init 8 bits, 2 lines, 5x7 character
acall SENDCC
mov A,#00001111b ;display on, cursor on, character blink on
acall SENDC
mov A,#00000001b ;home+clear
acall SENDC
ret

BUSY mov P3,#255 ;BusyFlag wait
clr P1.0
setb P1.1
acall STROBE
BF jb P3.7,BF
ret

SENDC clr P1.0 ;send commands
clr P1.1
mov P3,A
acall STROBE
acall BUSY
ret

SENDCC clr P1.0 ;this one is new
clr P1.1
mov P3,A
setb P1.2 ;although I did set it in LCDINIT, without this it doesn't give text on the lcd later (strange?)
mov teller,#255 ;why this? the lcd starts at a negative going enable pulse. doesn't it?
lus1 djnz teller,lus1
clr P1.2
acall BUSY
setb P1.2
ret

SENDD setb P1.0 ;send data
clr P1.1
mov P3,A
acall STROBE
acall BUSY
ret

GOTO orl A,#10000000b ;display address jump
acall SENDC
ret

STROBE clr P1.2 ;enable puls
nop
setb P1.2
ret

.end


List of 14 messages in thread
TopicAuthorDate
2x16 lcd: only 1 line works?            01/01/70 00:00      
   little addition            01/01/70 00:00      
      RE: little addition            01/01/70 00:00      
         RE: little addition            01/01/70 00:00      
   RE: 2x16 lcd: only 1 line works?            01/01/70 00:00      
   RE: 2x16 lcd: only 1 line works?            01/01/70 00:00      
      RTFM            01/01/70 00:00      
         RE: RTFM- ?            01/01/70 00:00      
            RE: RTFM- ?            01/01/70 00:00      
               RE: RTFM- ?            01/01/70 00:00      
            RE: RTFM- ?            01/01/70 00:00      
         RE: RTFM            01/01/70 00:00      
   RE: 2x16 lcd: only 1 line works?            01/01/70 00:00      
   it works now, but still some questions            01/01/70 00:00      

Back to Subject List