SPI GLCD Help needed - Page 2


+ Reply to Thread
Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 54

Thread: SPI GLCD Help needed2947 days old

  1. #16
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Les, Dave,
    the code to disable the entire graphic LCD library works (I had to change PRINT to PRINT,_ in order to chain all the lines).

    As before, the Print, Cls and Cursor redirects work OK using the names provided by Dave.

    But I must not be very smart as I canít figure out the ďnamesĒ required to redirect any of the other functions.
    For example to redirect Print the name is Print, to redirect Cls, the name is [email protected] and for Cursor the name is [email protected]
    However, for the other commands I canít figure out what name to use.

    For example Plot,y,x I tried Plot, [email protected], etc. but again none works and the compiler generates an error ďSymbol not previously defined __LCD_PLOT_Ē
    Another example LCDWrite y,x,[var] I tried LCDWrite, [email protected] doesínt work. I assumed it is redirected via Putbyte so I tried Putbyte, [email protected] and several other combinations but none was recognized by the compiler.

    Is there a convention for naming these commands in the ASM redirect? what am I missing?

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #17
    flosi
    Guest flosi's Avatar

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Can't you just do a search on a assembler file that contains the relevant keywords?

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #18
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Good idea, thanks

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #19
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    904
    Thumbs Up
    Received: 9
    Given: 3
    Total Downloaded
    1.72 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Look likes the plot info I gave you is wrong, __LCD_PLOT_ is an asm label the compiler is looking for when you use Plot
    and __LCD_WRITEBYTE_ for LCDWrite
    I think
    Regards
    Dave

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #20
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Dave, i know that what I need is the ASM "name" for redirecting to these commands. So if in the case of cursor it was [email protected], what would it be for LCDWrite?

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #21
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    904
    Thumbs Up
    Received: 9
    Given: 3
    Total Downloaded
    1.72 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    As last post __LCD_WRITEBYTE_
    I haven't tested this
    @ __LCD_WRITEBYTE_
    Cursor_Y = WREG
    Cursor_X = GEN
    DataByte = GENH
    GoTo Write_Byte_Routine
    Return
    Last edited by DaveS; 2nd May 2012 at 23:34.
    Regards
    Dave

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #22
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    OK, finally had some time and now everything works. Not the most elegant solution but it works OK and covers all the key commands as well as custom fonts in the FontConverter table structure. Thank you all for the help. Flosi, digging into the assembler was the best idea. Iíll try to put something on the wiki. Meanwhile, here are the disable and redirect portions:
    Code:
    Declare LCD_Type graphic'  
        '---[disable PDS GLCD lib]-----------------------     
        #disable Print,_
        GLCD_CLS,_
        GLCD_READ,_
        GLCD_READTEXT,_
        GLCD_WRITE,_
        GLCD_PIXEL,_
        GLCD_PLOT,_
        GLCD_CURSOR,_
        GLCD_CIRCLE,_
        GLCD_BOX,_
        GLCD_LINE,_
        GLCD_LOW_LEVEL
        '================================================
        GoTo EndOfGLCD                                  ' jump over all functions
        '================================================
    GlcdLibRedirect:
        '---[Redirect PDS GLCD lib]----------------------
        Asm 
        '------------------------------------------------
        [email protected]                                        ' Cls - clear the screen and the memory image
        GoTo ClsRedirect                  
        Return
        '------------------------------------------------
        [email protected]                                        ' Cursor ypos, xpos - Position the cursor on graphic LCD
        Movwf xpos                                      ' WREG = XPOS
        Movff GEN, ypos                                 ' GEN = YPOS (Line)            
        GoTo CursorRedirect                  
        Return
        '-----------------------------------------------
        Print                                           ' Print or Print at ypos, xpos 
        Movwf strbyte                                   ' WREG = character to display, strbyte must be put back to WREG at the end of the sub in case of repeating char
        GoTo PrintRedirect            
        Return
        '------------------------------------------------
        __LCD_PLOT_                                     ' Plot ypos, xpos
        Movwf xpos                                      ' WREG = XPOS
        Movff GEN, lpos                                 ' GEN = lpos is the row number 0-63 (Not Page/Line!)            
        Bsf pix_bit                                     ' set bit plot a pixel
        GoTo PlotRedirect                  
        Return
        '-----------------------------------------------
        __LCD_UNPLOT_                                   ' UnPlot ypos, xpos
        Movwf xpos                                      ' WREG = XPOS
        Movff GEN, lpos                                 ' GEN = lpos is the row number 0-63 (Not Page/Line!)            
        Bcf pix_bit                                     ' clear bit to unplot
        GoTo PlotRedirect                  
        Return
        '-----------------------------------------------
        __LCD_LINE_                                     ' Line set_clear, x-start, y-start, x-end, y-end
        Movwf y1                                        ' WREG = YPOS end
        Movff GENH, x1                                  ' GENH = XPOS end
        Movff GEN2H, lpos                               ' GEN2H = YPOS start
        Movff GEN2, xpos                                ' GENH = XPOS start
        Bsf pix_bit                                     ' set bit plot a pixel
        Btfss BPF,2                                     ' test BPF Bit 2 - skip next if bit is 1
        Bcf pix_bit                                     ' clear bit to unplot
        GoTo LineRedirect
        Return
        '-----------------------------------------------
        __LCD_CIRCLE_                                   ' Circle set_clear, xpos, ypos, radius
        Movwf radius                                    ' WREG = radius
        Movff GEN2, x0                                  ' GEN2 = YPOS
        Movff GEN2H, y0                                 ' GEN2H = XPOS 
        Bsf pix_bit                                     ' set bit plot a pixel
        Btfss BPF,2                                     ' test BPF Bit 2 - skip next if bit is 1
        Bcf pix_bit                                     ' clear bit to unplot
        GoTo CircleRedirect
        Return
        '------------------------------------------------
        __LCD_BOX_                                      ' box set_clear, xpos, ypos, size (only a square - see Rectangle below)
        Movwf radius                                    ' WREG = radius
        Movff GEN2, x0                                  ' GEN2 = YPOS
        Movff GEN2H, y0                                 ' GEN2H = XPOS 
        Movff BPF, pix_byte                             ' BPF to a var bit#2 is the plot/unplot flag
        GoTo BoxRedirect
        Return
        '------------------------------------------------
        __LCD_WRITEBYTE_                                ' LCDWrite ypos, xpos,[byte,{byte etc...}]
        Movwf Char                                      ' the byte to write at page
        Movff GEN, ypos                                 ' load to page var
        Movff GENH, xpos                                ' load to col var
        Incf GENH                                       ' col +1 for next then byte if any
        GoTo LCDWriteRedirect
        Return
        '-----------------------------------------------
        EndAsm

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #23
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    OK its on the Wiki, just need a moderator to publish

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #24
    wastrix
    Guest wastrix's Avatar

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    It's published, thanks.

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #25
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    904
    Thumbs Up
    Received: 9
    Given: 3
    Total Downloaded
    1.72 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Hi Barak

    You beat me to it, here's where I got to it's not finished, but it works with 16F and 18F devices covered Lcdread and Pixel haven't done box yet got stuck on LineTo losing pos Start or End forget at moment.
    My goal was to mimic exactly what you would get if using the compiler driver so I knocked up a driver for the KS0108 will cover 64x64, 128x64, 192x64, 128x128 eventually.
    Still to do alias some of the drawing vars, I had problems so not done yet.
    So for a base template for other drivers, we just do what the compiler driver does, it then should be easy to change for a different controller chip.
    Then we can add fancy stuff later such as variable width & height chars, should have a define to select simple or any size width & height chars.
    I also have my own routine for printing variable any size width & height chars or images this prints in whole bytes not pixels so hopefully should be faster, should also work with a Toshiba screen with slight mods, I will share this later.

    I think it's a bit early to publish, I would like to see a common lcd driver template

    KS0108_Driver.zip
    Regards
    Dave

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #26
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Hi Dave,
    It looks like your KS0108 driver is on a bigger scale then my SPI-GLCD specific piece of code. Feel free to integrate anything from my demo into your driver so it can also support ST7565 based GLCDs (the can be parallel or SPI).
    The demo is not a real "driver", it's based on a commercial project that I'm currently working on.
    Check the wiki at http://www.protonbasic.co.uk/content...65R-Controller It explains the project and you can download the demo code from a link on the wiki.

    Overall, I feel that it can be done more elegantly and efficiently, if I could only figure a way to intercept and redirect only the actual communications with the LCD so all the library commands will be done in the original compiler routines.

    I don't know much about AMICUS but since it uses 18F2XK2X, I'm sure it quickly gets low on I/O's so SPI GLCD may be a better way to go. Also, the cost of LCDs with ST7565 controller is really low, I have quotes from China for a 128x64 SPI GLCD with back light for as low as $3 a piece at 100pcs!
    These considerations, I hope, will motivate Les to add, in his "spare time", support of SPI GLCDs with ST7565 controller. Either by adding an option to the GLCD_Type that will internally route to SPI and ST7565 controller commands, or by developing a real driver like the one in Amicus18_Colour_Glcd_Shield (it will be way simpler for ST7565).

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #27
    Senior Member DaveS's Avatar
    Join Date
    Aug 2004
    Posts
    904
    Thumbs Up
    Received: 9
    Given: 3
    Total Downloaded
    1.72 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Hi Barak

    Excellent job done with your driver.

    I picked the KS0108 chip because I could test in Isis.
    When I get time I will finish it and if it's good enough to use as a base template for other drivers.
    I dont think you can use the compilers build in drawing routines, because it's calling for other labels such as [email protected] etc, although could add these, to much to figure out for me.
    Personaly I think Les is better off spending time on the compiler, than writing glcd drivers.
    Regards
    Dave

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #28
    PhilJ1
    Guest PhilJ1's Avatar

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    I've been trying to compile the demo as posted and I'm coming up with all sorts of errors - I'm using IDE 2.0.1.0, Compiler is 3.5.2.3 win 7 64bit - is anybody else ?

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #29
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    726
    Thumbs Up
    Received: 30
    Given: 11
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    It was developed with the beta version. I just compiled it with no errors on beta version 3.5.3.9 (ide 2.0.1.2)

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  29. #30
    PhilJ1
    Guest PhilJ1's Avatar

    0 Not allowed!

    Default Re: SPI GLCD Help needed

    Click image for larger version

Name:	GLCD_Spi_err.jpg
Views:	45
Size:	96.5 KB
ID:	1514

    Thanks for getting back to me, after upgrading to the same version as you have - I get the above problem - I simply downloaded your Demo from the wiki and tried to compile - hope you can advise

    Cheers

  30. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Chip needed
    By charliecoultas in forum The Lounge
    Replies: 11
    Last Post: 5th February 2018, 15:57
  2. SPI Help Needed PLEASE ?
    By craig in forum Proton Plus Compiler v3
    Replies: 15
    Last Post: 26th January 2015, 20:10
  3. 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
  4. Replies: 7
    Last Post: 21st June 2012, 16:43
  5. Cheap GLCD needed
    By Tim in forum The Lounge
    Replies: 15
    Last Post: 8th September 2009, 18:10

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