Today 13:48
Forum: Website / Forum Issues
Starter: towlerg
Views: 2
Replies: 0
Go to last post By: John Drew
Today 12:45
Forum: The Lounge
Starter: SimonJA
Views: 113
Replies: 4
Today 11:51
Forum: In Circuit Debugger
Starter: DaveS
Views: 6288
Replies: 23
Today 08:44
Forum: LCD module
Starter: Ledroj
Views: 179
Replies: 6
Yesterday 22:24
Forum: The Lounge
Starter: Henk57
Views: 45
Replies: 1
Yesterday 16:27
Forum: Proton 24
Starter: rcurl
Views: 39
Replies: 1
Yesterday 14:55
Forum: Proton 24
Starter: johngb
Views: 42
Replies: 1
+ Reply to Thread
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 54

Thread: SPI GLCD Help needed1793 days old

  1. #1
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Default SPI GLCD Help needed

    Iím working with SPI GLCD EADOGM128-6 http://www.lcd-module.com/eng/pdf/grafik/dogm128e.pdf
    I want to make it compatible with PDS GLCD commands, similar to what I did with their SPI Alfa LCD (see http://www.protonbasic.co.uk/content...-Print-command). With the Alphanumeric SPI it was easy: once the redirected Print function distinguished between data or command ($FE), all its derivatives such as Cls, Cursor and Print At x,y automatically functioned correctly. Unfortunately, with GLCD itís more complicated. I followed a similar concept. I got it to work with the Print command but I have to get to the x, y coordinates in separate functions and I have no idea how to include coordinates in comands such as Print At x,y,..., Cursor x,y, Plot x,y, etc.
    Here is what I got now:
    Code:
    LCD_Type = GRAPHIC
    #Disable Print    ' "hack" the Print command
    
    '===[Print command redirect]=====================
        @Print                    ' ASM Print redirect 
        WREG_BYTE LCDBYTE            ' load LCDBYTE to the W Register 
        GoTo GLCD_WriteAscii         ' executed in GLCD_WriteAscii
    '================================================
    
    GLCD_WriteAscii:                               
        High A0   ' send as Data
        Low CS1B   ' CSN
        For lcd_indx = 0 To 5
            font_indx = LCDBYTE * 6 + lcd_indx ' pointer to font table
            lcd_temp = CRead8 Font[font_indx] ' get font bytes
            GoSub SPI_GLOBAL[lcd_temp]         ' SPI to GLCD
        Next
        High CS1B
        Return      
    
    GoPageCol:
        lcd_temp = (y & 0x0F) | 0xB0             ' page address + 110000 
        GoSub GlcdCmd[lcd_temp]
         GoSub GoColumn                     
        Return 
    
    GoLineCol:
        lcd_temp = (~linepos & 0x3F) | 0x40    ' inverted line number + 1000000 so 0 is the top of the screen
        GoSub GlcdCmd[lcd_temp]
        GoSub GoColumn                     
        Return
    
    GoColumn:
        lcd_temp = (x >> 4)| 0x10                ' column address high nibble + 010000 
        GoSub GlcdCmd[lcd_temp]                     
        lcd_temp = x & 0x0F                     ' column address low nibble
        GoSub GlcdCmd[lcd_temp]
        Return
    The above allow me to use the Print command with the benefits of string formatting etc.
    For example,this code works fine:
    Code:
    Y = 3
    X = 63
    Gosub GoPageCol 
    Print ďABCĒ, Hex2 Var1
    Can anyone point me in the right direction for ďhackingĒ PDS's GLCD commands which include coordinates (Print At, x, y, Plot x,y etc.) ?

  2. #2
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    924
    Thumbs Up
    Received: 11
    Given: 1
    Total Downloaded
    676.35 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Declare LCD_Type graphic

    Dim Cursor_X as byte
    Dim Cursor_Y as byte
    Dim Char as byte

    #Disable GLCD_CLS
    #Disable GLCD_CURSOR
    #Disable Print

    GoTo EndOfOverrides
    Asm
    GLCD@CLS
    GoTo Clear_GLCD_Routine
    Return
    GLCD@CUR
    Movwf Cursor_X ;var
    Movff GEN,Cursor_Y ;var
    GoTo Cursor_Routine
    Return
    Print
    Movwf Char ;var
    GoTo Print_Char_Routine
    Return
    EndAsm
    EndOfOverrides:

    There might be some info here
    http://www.protonbasic.co.uk/showthr...LCD-6x8-format
    Regards
    Dave

  3. #3
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Thanks Dave,
    This is exactly what I wanted. But I’m getting an ASM error:
    ASM Error[113] symbol not previously defined (GEN)
    My knowledge of asm is close to zero.
    What is GEN?

  4. #4
    Moderator wastrix's Avatar
    Join Date
    May 2008
    Posts
    2,874
    Thumbs Up
    Received: 2
    Given: 3
    Total Downloaded
    0

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Quote Originally Posted by barak View Post
    Thanks Dave,
    This is exactly what I wanted. But I’m getting an ASM error:
    ASM Error[113] symbol not previously defined (GEN)
    My knowledge of asm is close to zero.
    What is GEN?
    GEN is one of the compiler's system variables. This could for a wide variety of reasons, but possibly your code has disabled the compiler code that uses GEN, which means the compiler has left it out but is still trying to pass your code a value in GEN.
    "If you have an important point to make, don't try to be subtle or clever. Use a pile driver."
    - Winston Churchill
    If you want to contact me, please email me, don't PM me.

  5. #5
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Thanks for clarifying.
    What can I do to get around it?
    Is Movff GEN,Cursor_Y is trying to get the second arguments (Y) from stack?

  6. #6
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    OK, as soon as i added a Print At, x, y command the error went away so the compiler must have added GEN for the cursor position. Its working now. Great support guys.
    I’ll check all the different options and report back
    Last edited by barak; 30th April 2012 at 23:53.

  7. #7
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Smile Re: SPI GLCD Help needed

    The good news, using Daveís ASM overrids, the Print At y,x, Cursor y,x and Cls all work great so it looks promising
    The problem is now I got greedy and want to use all PDS GLCD commands including LcdWrite, Plot,UnPlot, LINE, LineTo, Circle and Box.
    I tried all sort of combinations but to no avail. Iím in the dark here and would appreciate more help so we can finally use these thin, low cost, low voltage LCDís with all PDS GLCD commands. Thanks.

  8. #8
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    924
    Thumbs Up
    Received: 11
    Given: 1
    Total Downloaded
    676.35 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Hi Barak

    I can't claim credit for the overrides I got the info of Tim a long time ago.
    I think I got some of the drawing functions working, no idea if I still have the code, have a look at Plot in asm view, that should give you line, circle and box.
    Regards
    Dave

  9. #9
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    924
    Thumbs Up
    Received: 11
    Given: 1
    Total Downloaded
    676.35 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    N7110_Test_4.zip

    Found this think its an early one, could be improved, I have a routine to print any size text at any position, some where which I would of released with Icon Cruncher plugin which I didn't finish.
    Regards
    Dave

  10. #10
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    718
    Thumbs Up
    Received: 47
    Given: 11
    Total Downloaded
    473.80 MB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Thanks Dave. I can’t see how the code in N7110_Test does what I want.
    I already got the Print At y,x Cursor y,x and Cls to work.
    What I want is the overriding ASM code for redirecting LcdWrite, Plot, UnPlot, LINE, LineTo, Circle and Box to the SPI and to the coordinates subroutines that I already have for the EA DOGM128-6 GLCD.
    Eventually if this works it will be possible to use most PDS GLCD library with the EA DOG SPI GLCD or others that use ST7565R lcd controller

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. SPI - (Can't belive a search on SPI yields no results?)
    By Peter Truman in forum Proton Plus Compiler v3
    Replies: 12
    Last Post: 30th September 2012, 10:12
  2. Replies: 7
    Last Post: 21st June 2012, 16:43
  3. Cheap GLCD needed
    By Tim in forum The Lounge
    Replies: 15
    Last Post: 8th September 2009, 18:10
  4. Another connector needed.
    By See_Mos in forum Wanted and For Sale
    Replies: 0
    Last Post: 17th July 2009, 09:01
  5. advice needed
    By C_Moore in forum The Lounge
    Replies: 7
    Last Post: 4th July 2006, 15:48

Members who have read this thread since 17th March 2017, 22:55 : 1

Actions :  (Set Date)  (Clear Date)

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

Tags for this Thread

Posting Permissions

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