EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Hello,

    I'm playing around with a EA-DOGM-163 LCD (16 characters, 3 lines).
    Name:  EA DOGM081E-A_sml.jpg
Views: 820
Size:  7.9 KB
    This LCD is equipped with a ST7036 controller.

    For tests, I have built my project and made this display work with an 8 bits bus - and it works ...at least, only the first line is okay.

    But when it comes to display some text on a specific line, I can't achieve it.
    Code:
    ' ====== FUSES =====================================================================================
    ' PIC 16F690
    @ __Config _FCMEN_OFF &_IESO_OFF &_CPD_OFF &_WDT_OFF &_HS_OSC &_BOR_OFF &_CP_OFF &_PWRTE_OFF &_MCLRE_OFF 
    
    ' ====== REGISTERS =================================================================================
    '             76543210
    OPTION_REG = %10000000 ' PORT A&B Pull-Ups (look WPUA & WPUB)
    ANSEL      = %00000000 ' Analog inputs Channels 0 to 7
    ANSELH     = %00000000 ' Analog inputs Channels 8 to 11
    ADCON0     = %00000000 ' A/D Module is OFF
    CM1CON0    = %00000000 ' Comparator1 Module is OFF
    CM2CON0    = %00000000 ' Comparator2 Module is OFF
    INTCON     = %00000000 ' INTerrupts CONtrol
    PORTA      = %00000000 ' Ports High/Low (0 to 5)
    TRISA      = %00000000 ' Set Input/Output (0 to 5)
    PORTB      = %00000000 ' Ports High/Low (4 to 7)
    TRISB      = %00000000 ' Set Input/Output (4 to 7)
    PORTC      = %00000000 ' Ports High/Low (0 to 7)
    TRISC      = %00000000 ' Set Input/Output (0 to 7)
    
    ' ====== DEFINES =================================================================================
    DEFINE OSC 8
    
    DEFINE LCD_DREG PORTC  ' LCD data port 
    DEFINE LCD_DBIT 0      ' LCD data starting PORT.bit (0 or 4)
    DEFINE LCD_RSREG PORTB ' LCD register select port 
    DEFINE LCD_RSBIT 4     ' LCD register select bit 
    DEFINE LCD_EREG PORTB  ' LCD enable port 
    DEFINE LCD_EBIT 6      ' LCD enable bit 
    DEFINE LCD_BITS 8      ' LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 3     ' Number lines on LCD 
    
    ' ====== INITIALIZATION ===================================================================================
    ' EA-DOG-Mx settings
    PAUSE 1000      'Time to power-up this display (THIS IS CRUCIAL!!!)
    LCDOUT $FE, $39 'Function Set: 8 bits bus mode
    LCDOUT $FE, $1D 'Bias set, 3-lines display (5V=$1D / 3,3V=$15)
    LCDOUT $FE, $52 'Power control + Contrast (HiByte) (5V=$52 / 3,3V=55)
    LCDOUT $FE, $69 'Follower control (5V=$69 / 3,3V=6D)
    LCDOUT $FE, $70 'Contrast (LowByte)
    LCDOUT $FE, $38 'Function Set: switch back to instruction table 0
    
    ' ====== PROGRAM ===================================================================================
    ' Program
    MAIN:
    
    LCDOUT $FE,  1     ' clear display
    LCDOUT $FE,  2,"1" ' beginning of line 1
    LCDOUT $FE,$10,"2" ' beginning of line 2
    LCDOUT $FE,$20,"3" ' beginning of line 3
    
    END
    According to the controller's datasheet, ST7036 is instruction compatible with HD44780. But if I try to use values like $C0 (beginning of second line) or $94 (beginning of third line), it won't work.
    Name:  2016-08-07 20_35_02-Clipboard.jpg
Views: 799
Size:  37.9 KB

    Looking again in the ST7036's datasheet, page 20, one can read this:
    Name:  ST7036 compatible.jpg
Views: 834
Size:  57.5 KB

    So, as it is now in my code, I used $10 and $20 values...but it still doesn't work.

    Anyone an idea where I'm wrong?
    Roger

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Roger,

    I'm no expert, but most of the routines I've seen and used in PBP tend to use 4 bit mode for HD44780 based LCD's so maybe the following might help (?) - you may need to change some pins to match your hardware

    Code:
    DEFINE LCD_DREG  PORTB                  ' LCD Data port
    DEFINE LCD_DBIT  0                      ' starting Data bit (0 or 4)
    DEFINE LCD_EREG  PORTB                  ' LCD Enable port
    DEFINE LCD_EBIT  5                      '     Enable bit  (on EasyPIC 5 LCD)
    DEFINE LCD_RSREG PORTB                  ' LCD Register Select port
    DEFINE LCD_RSBIT 4                      '     Register Select bit   (on EasyPIC 5 LCD)
    DEFINE LCD_BITS  4                      ' LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 3                      ' number of lines on LCD
    DEFINE LCD_COMMANDUS 2000               ' Command delay time in us 
    DEFINE LCD_DATAUS 50                    ' Data delay time in us

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Set DDRAMAddress 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0

    try this , looks like you need to set bit 7 and add dram ADDRESS

    LCDOUT $FE, 1 ' clear display
    LCDOUT $FE, 130,"1" ' beginning of line 1
    LCDOUT $FE,$90,"2" ' beginning of line 2
    LCDOUT $FE,$a0,"3" ' beginning of line 3
    Warning I'm not a teacher

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Thanks a lot Richard,

    It works now as expected with this code:
    Code:
    LCDOUT $FE,  1     ' clear display
    LCDOUT $FE,  2,"1" ' beginning of line 1
    LCDOUT $FE,$90,"2" ' beginning of line 2
    LCDOUT $FE,$A0,"3" ' beginning of line 3
    May I kindly ask you to explain how you found out those values please?


    looks like you need to set bit 7 and add dram ADDRESS
    Hum...I don't get this; what do you mean?
    Roger

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    May I kindly ask you to explain how you found out those values please?
    bit 7 = 128 =$80

    Code:
                            hex       dec              
    row1  dram  address  =   0          0          128 + 0 = 128   = $80 
    row2  dram  address  = $10         16          128 +16 = 144   = $90 
    row3  dram  address  = $20         32          128 +32 = 160   = $A0
    Last edited by richard; - 9th August 2016 at 01:03. Reason: white space
    Warning I'm not a teacher

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Thank you again Richard.

    My knowledge of the "datasheet language" is apparently still poor

    Can you tell where this info is to be found in there?

    I'm lucky I've got you helping me (thanks again), but it's so frustrating not being able to find this by myself ...you know what I mean
    Roger

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    from st7036 data sheet
    Attached Images Attached Images  
    Warning I'm not a teacher

  8. #8
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default EA-DOGM-163 with ST7036 LCD controller - can't find address for line 2 and 3

    Thank you Richard.

    Obviously, I have some lacks in basic knowledge of "display's controller" science since I can't still correlate your information and how I should understand it affects the cursor's position on the display

    I stop bothering you now; you gave me the solution and I thank you very much again for it
    Roger

  9. #9
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default "DDRAM" corresponds to a character position on display (but...)

    The controller contains n bytes of Display Data Random Access Memory which is usually referred to as DDRAM.

    Each of these DDRAM memory addresses corresponds to a character position on an attached display, but the specific position varies depending on the configuration of that display.
    This is what I was missing and this info can be found here
    Roger

Similar Threads

  1. How to find I2C Slave address of PIC24FJ256GA110?
    By sharath12 in forum Off Topic
    Replies: 2
    Last Post: - 19th March 2012, 15:21
  2. Shiftout Modifiers for SPI LCDs (DOGM series)
    By jbike123 in forum PBP Wish List
    Replies: 0
    Last Post: - 9th November 2010, 01:08
  3. Replies: 12
    Last Post: - 4th March 2010, 22:20
  4. Need advise how find problem in PID controller
    By phoenix_1 in forum Off Topic
    Replies: 0
    Last Post: - 28th October 2009, 02:22
  5. 2 Line Chars on a 2 Line LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th November 2003, 01:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts