Shop OBEX P1 Docs P2 Docs Learn Events
EA DOGM-162 Display — Parallax Forums

EA DOGM-162 Display

FriedVFriedV Posts: 77
edited 2011-10-09 11:26 in Propeller 1
Hi,
has someone here experience with this Display?
I try in vain to init it correctly, following strictly the manual and the example C program shown by EA on their site, but it simply will not work. It is connected to a C3 propeller board using a 74HCT541 bus buffer,
the hardware works correctly all the 4 signals (MOSI, MCLK, CBS and RS show all right on LA and PicoScope.
Here is the init routine, in fact very simple:
' ----------------------------------------------------------------------
' File......  C3_SPI.pbas
' Author....  fgvissel  30.09.2011
' for C3 Board with 6,26 MHz X-tal
' ======================================================================

' ----- Device Settings ------------------------------------------------
  DEVICE P8X32A, XTAL1, PLL16X
  XIN 6_250_000

' ----- Conditional Compilation Symbols --------------------------------
 
' ----- Constants ------------------------------------------------------

' ----- IO Pins --------------------------------------------------------
  PSI_CLR Pin 25 High
  PSI_CLK Pin  8 High

  RS      Pin 10 Output
  MOSI    Pin  9 Low
  MCLK    Pin 11 High   'Shiftout toogles the clock from High to Low to High
                        'so MCLK is active Low            
                        

' ----- Shared (HUB) Variables (Byte, Word, Long) ----------------------

' ----- User Data (DATA, WDATA, LDATA, FILE) ---------------------------

' ----- TASK Definitions -----------------------------------------------

' ----- Local Variables (LONG only) ------------------------------------
  channel var long
' ----- SUB and FUNC Definitions ---------------------------------------
  DelayMS SUB 1
  DelayUS SUB 1
  SPI_Out SUB 1

' ======================================================================

PROGRAM Start

Start:
low PSI_CLR         'reset CS Counter in C3
high PSI_CLR 


channel = 0         'select S6 device
do 
  low PSI_CLK
  high PSI_CLK
  inc channel
loop until channel = 6

low RS
High rs
low rs


'Init DOGM-162 LCD for 5V, 8bit  SPI operation

  DelayMS 40
  SPI_Out $38   'function set 8 bit
  SPI_Out $39   'function set 8 bit, Inst. Table 1
  SPI_Out $1C   'bias set (1/4 bias)
  SPI_Out $52   '3V Booster off, Contrast internal follower mode
  SPI_Out $69   'follower control
  DelayMS 200   'wait to stabilize
  SPI_Out $74   'contrast set
  SPI_Out $38   'back to Inst. Table 1
  SPI_Out $0F   'Display on
  SPI_Out $01   'Clear Display
  DelayMS 2
  SPI_Out $06   'cursor auto inc
high RS         'end of command sequence
   SPI_Out $41  ' write "A" to display
   DelayMS 10
                ' and loop forever

Main:
' program code
GOTO Main
END

' ----- SUB and FUNC Code ----------------------------------------------
  SUB DelayMS
  pause __param1
  ENDSUB

  SUB DelayUS
  pauseus __param1
  ENDSUB

  SUB SPI_Out

    shiftout MOSI, MCLK, MSBFIRST,  __param1
    DelayUS 50
  ENDSUB

  
' ----- TASK Code ------------------------------------------------------



' ----------------------------------------------------------------------

Has someone running this beast?
Thx, Friedrich

Comments

  • FriedVFriedV Posts: 77
    edited 2011-10-02 11:14
    Well I gave up on this one, seems the SPI is a little flawed, must be harware resetted etc. This would yield to a 5 lines interface, to much.
    So I prefer the Sparkfun solution with the AVR controller & serial interface to the propeller & parallel to the LCD.
    Maybe I develop an parallel 8-bit Prop or AVR subsystem fpr the dogm's.
    Cheers, Fried
  • lanternfishlanternfish Posts: 366
    edited 2011-10-02 17:16
    Hi FriedV

    The display can be hardware reset (on startup) by tying the reset line to Vdd.

    Cheers
  • MGreimMGreim Posts: 114
    edited 2011-10-03 10:42
    I am also using this kind of displays, its a little bit "widerspenstig"

    Maybe this may help you.

    http://forums.parallax.com/showthread.php?109792-Another-driver-for-the-EA-DOGM-126-6-(controller-ST7656R)&highlight=Greim

    Regards

    Markus
  • FriedVFriedV Posts: 77
    edited 2011-10-09 11:23
    I finally found the problem with the EA DogM162:
    I tied the ^CSB pin permanently low. This disturbes the LCD, because at the Start of the propeller the
    pins float wildly. So the LCD cannot sync itself, only by chance. It is for a good reason that the data sheet of the DogM does not show this pin tied to ground. So you must really drive all 4 interface pins
    SI, CLK, RS and ^CSB.
    Here is the working code for initializing the LCD in SPI mode:
    ' -------------------------------------------------------------------
    ' File......  DogM162.pbas
    ' Author....  fgvissel  09.10.2011
    ' for Propeller with 6,26 MHz X-tal
    ' ===================================================================
    
    ' ----- Device Settings ---------------------------------------------
      DEVICE P8X32A, XTAL1, PLL16X
      XIN 6_250_000
    
    ' ----- IO Pins -----------------------------------------------------
      RS      Pin 10 High        '<--> EA DogM162  Pin 39 
        CSB            Pin  8 High        '<--> EA DogM162  Pin 38
      MOSI    Pin  9 Low        '<--> EA DogM162  Pin 28
      MCLK    Pin 11 High        '<--> EA DogM162  Pin 29
    
                                                    'Shiftout toogles the clock High > Low > High
                                                    'so MCLK is idle High and active Low
                                                    'Data is transferred on the rising edge of MCLK
    
                                                    '<==> EA DogM162 other Pins:
                                                    '24,25,26,30,31,32,33,34,35,36,37,40 <-> +5V
                                                    '23,27 <-> GND
                                                    '21,22 Not connected
                            
    ' ----- SUB and FUNC Definitions ------------------------------------
      DelayMS SUB 1
      DelayUS SUB 1
      SPI_Out SUB 1
    
    ' ===================================================================
    
    PROGRAM Start
    Start:
      DelayMS 200                'Init DOGM-162 LCD for 5V, 8bit  SPI operation
        low CSB                        'Chip select, Sync with Propeller
        low RS                        'Command mode for LCD
        DelayMS 10
        
        SPI_Out $38
      SPI_Out $39
      SPI_Out $1C   
      SPI_Out $74   
      SPI_Out $52     
      SPI_Out $69
        DelayUS 250
      SPI_Out $0F
      SPI_Out $01                'Clear Display
        DelayMS 20                'End of Init
    
        high RS                        'Data mode for LCD, Output: "ABC"        
        SPI_Out $41 
        SPI_Out $42
        SPI_Out $43
        '------------------------------------------------------------------
    
    Main:
        ' nothing
        goto Main
    END
    
    ' ----- SUB and FUNC Code -------------------------------------------
    SUB DelayMS
    pause __param1
    ENDSUB
    
    SUB DelayUS
    pauseus __param1
    ENDSUB
    
    SUB SPI_Out
        shiftout MOSI, MCLK, MSBFIRST,  __param1
        DelayUS 50
    ENDSUB
    
    ' ===================================================================
    
    The resulting Pin changes is shown on the 2 attached LogicPort Analyzer screenshots.

    Hope this helps someone!
    Cheers, Fried
    1024 x 336 - 67K
    1024 x 336 - 69K
  • FriedVFriedV Posts: 77
    edited 2011-10-09 11:26
    Sorry about the ragged code, the code window does not like tab character only 2 spaces wide?
    Friedrich
Sign In or Register to comment.