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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/22/06 07:38
Read: times


 
#129972 - LCD reset
Responding to: ???'s previous message
1)LCD reset routine is much important that cable length ,
on longer cable You must slow down operations (add NOP's).
Play around with reset routine.
2)Abnormal fast execution - first check XTAL, second check
reset circuit and supply, but error will be in code - with 99% probability.

Below is piece of code, i'm using to reset LCD 16x2 - You see
reset is performed 3..4 times, this can be asumed as error or
irrational, but tis code is working on more than xx,000 pcs
taximeters.

regards,
Stefan


LCDRESET:
mov r2,#25
call delayr2 ;250ms
call xxxreset
mov r2,#25
call delayr2
call xxxreset
mov r2,#25
call delayr2
call xxxreset
xxxreset:
LCALL SETLCD8
LCALL SETLCD8
LCALL SETLCD8
MOV A,#8 ;DISPLAY , DISPLAY OFF,CURSOR OFF,BLINKING OFF
LCALL WLCDCOMMAND;
MOV A,#13 ;DISPLAY , DISPLAY ON,CURSOR OFF,BLINKING OFF
LCALL WLCDCOMMAND ;
mov r2,#3
lcall delayR2
MOV A,#9 ;DISPLAY , DISPLAY OFF,CURSOR OFF,BLINKING ON
LCALL WLCDCOMMAND;
MOV A,#12 ;DISPLAY , DISPLAY ON,CURSOR OFF,BLINKING OFF
LCALL WLCDCOMMAND;
MOV r2,#3
lcall delayR2
LCALL CLEARLCD
LCALL CLEARLCD
LCALL CURSORLCDHOME
MOV A,#6 ;ENTRY SET ;CURSOR INCREASE ; DISPLAY IS NOT SHIFTED
LCALL WLCDCOMMAND ;
MOV A,#16;20 ;SHIFT ;CURSOR SHIFT ,LEFT
LJMP WLCDCOMMAND;
SETLCD8:
mov r4,#4
MOV A,#BUS8SET_LCDCOM
setlcd8loop1:
lcall LCDCOMMAND ;send withowt busy checking
mov r2,#2
lcall delayr2
djnz r4, setlcd8loop1
SJMP WLCDCOMMAND ;wait ready and send


CLEARLCD:
MOV A,#CLRDISPL_LCDCOM
SJMP WLCDCOMMAND
CURSORLCDHOME:
MOV A,#CURSORHOME_LCDCOM
SJMP WLCDCOMMAND


WLCDCOMMAND:
LCALL LCDCOMMAND ;write command
SJMP WAITLCD ;wait ready



BUS8SET_LCDCOM EQU 56 ;


List of 17 messages in thread
TopicAuthorDate
at 89S52 chip acting unreliably            01/01/70 00:00      
   LCD reset            01/01/70 00:00      
   Processor Reset            01/01/70 00:00      
   at 89S52 chip acting unreliably            01/01/70 00:00      
      no oscilloscope, use LED            01/01/70 00:00      
      Proper Reset - not RC!            01/01/70 00:00      
         make reset "hybrid" chip with opamp            01/01/70 00:00      
            that is plain crazy            01/01/70 00:00      
               allmost crazy            01/01/70 00:00      
                  Why take the risk?            01/01/70 00:00      
      use a proper supervisor chip            01/01/70 00:00      
   Thank you            01/01/70 00:00      
      What a supervisor does            01/01/70 00:00      
      Keyboard problem?            01/01/70 00:00      
         Re. Keyboard problem?            01/01/70 00:00      
            RC            01/01/70 00:00      
               evrything you wanted to ask about RC reset...            01/01/70 00:00      

Back to Subject List