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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/11/08 12:09
Read: times


 
#150554 - I work in 4 bit mode
Responding to: ???'s previous message
I use LCD working with 4 bits mode. It works well with dsPIC microcontroller (dsPIC30F3014, programmed in C Language) and still works well with ATMEL microcontroller (AT89C51-ed2, programmed in Assembly Language)

Your steps to initialize the LCD are not equal to the ones I do.

The codes I send to LCD initialization are (in Hexadecimal): 0x03, 0x03, 0x03, 0x02, 0x28, 0x0C .

My code in assembly is :
(p0.0 from ATMEL linked with D7 from LCD,..., p0.3 linked with D4 from LCD. D3, D2, D1 and D0 of the LCD are put to ground! )

//////
ini_lcd:
clr rs
clr en

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
clr p0.1
setb p0.2
setb p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
clr p0.1
setb p0.2
setb p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
clr p0.1
setb p0.2
setb p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;


;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
clr p0.1
setb p0.2
clr p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;


;;;;;;;;;;;;;;
clr p0.0
clr p0.1
setb p0.2
clr p0.3

setb en
acall delay_5ms
clr en

setb p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

setb p0.0
setb p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;


;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
setb p0.1
setb p0.2
clr p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
setb p0.1
setb p0.2
clr p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;

;;;;;;;;;;;;;;
clr p0.0
clr p0.1
clr p0.2
clr p0.3

setb en
acall delay_5ms
clr en

clr p0.0
clr p0.1
clr p0.2
setb p0.3

setb en
acall delay_5ms
clr en
;;;;;;;;;;;;;;


ret
//////

I hope it works for you.

carlosjunior@gmail.com

List of 44 messages in thread
TopicAuthorDate
LCD in 4Bit mode trouble            01/01/70 00:00      
   For a start            01/01/70 00:00      
   How to post source code            01/01/70 00:00      
   HD44780 in 4 bit mode timings            01/01/70 00:00      
      Thanks, but still doesnt work            01/01/70 00:00      
         Tied lines            01/01/70 00:00      
            RW line tied to GND            01/01/70 00:00      
               R/W is tied to ground by hardware            01/01/70 00:00      
               have a look at this in code library            01/01/70 00:00      
            It worked!            01/01/70 00:00      
               It worked!            01/01/70 00:00      
                  d0-d3            01/01/70 00:00      
                     d0-d3 I still insist they should be left open !            01/01/70 00:00      
                        Proof            01/01/70 00:00      
                           They already have internal pullups            01/01/70 00:00      
                              Where ?            01/01/70 00:00      
                                 Please find the " Pull-up MOS " in the datasheet            01/01/70 00:00      
                                    Thanks            01/01/70 00:00      
                        I never insisted ont tieing them            01/01/70 00:00      
   can\'t help it            01/01/70 00:00      
      Noritake            01/01/70 00:00      
         Noritake            01/01/70 00:00      
            'life' for as long as it lasts            01/01/70 00:00      
               Please provide the datasheet part info            01/01/70 00:00      
                  I do not have it            01/01/70 00:00      
   I never insisted ont tieing them            01/01/70 00:00      
      Powertip - pc1602f            01/01/70 00:00      
   2 more things            01/01/70 00:00      
   I am getting 50\'000Hrs , with 80Cd/m2 , they            01/01/70 00:00      
   I work in 4 bit mode            01/01/70 00:00      
      All that code reduces to:            01/01/70 00:00      
         Thanks by the code size reduction            01/01/70 00:00      
            Tools            01/01/70 00:00      
               sure, but why            01/01/70 00:00      
                  time for a new thread...            01/01/70 00:00      
            Free IDE            01/01/70 00:00      
               it does not make sense            01/01/70 00:00      
                  Ops,,, Topic changes!            01/01/70 00:00      
                     one thing at a time            01/01/70 00:00      
                        Why bin file and not hex directly            01/01/70 00:00      
                  re: it does not make sense            01/01/70 00:00      
                     it does not matter 'how long'            01/01/70 00:00      
                        Not recommending anything            01/01/70 00:00      
         The swap command should not exist !!?            01/01/70 00:00      

Back to Subject List