How exactly LCDOUT statement works?


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    Say if 1% precision for me is enough, still 18F needed?

  2. #2
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    Got some time and tested that approach with ST7920. And it indeed works.
    While PBP seems to beginning to belong to dead language category, I'll leave this simple code here anyways - maybe someone will find it useful.

    ST7920 is wired as standard HD44780 in 4 bit mode. With appropriate LCD pins defined.

    Code:
    LCDOUT $FE,$2E 'enable graphic mode
    LCDOUT $FE,$80 'set Y position to zero (Top)
    LCDOUT $FE,$80  set X position to zero (Left)
    LCDOUT 255 'draw a line consisting of 8 pixels in top left row
    Note: X counter increases after each write by itself, but Y counter - not, so you have to do it manually.

    And this simple code fills up entire screen with white:

    Code:
    LCDOUT $FE,$2E
    for Z=0 to 32
    LCDOUT $FE,$80+z
    LCDOUT $FE,$80
    FOR x=1 TO 18
    LCDOUT 255
    NEXT
    next

  3. #3
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    How to send $FE with LCDOUT ?
    X=$FE
    LCDOUT X

    It sends statements instead of byte data Found this accidentally - one of my custom font letters contained $FE pixels, and when using that char, it blowed up all my code. Took me several days to figure the reason (I was thinking about faulty EEPROM, display controller, SRAM on PIC and so on)

  4. #4
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    Any ideas?
    This is very annoying and trashes whole idea of using LCDOUT statement...

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    At the very beginning of this thread we went over how LCDOUT works, how it determines if what you give it should be sent as data or as commands, ie the $FE prefix. Now, a couple of weeks later you claim to have found this by accident and all of a sudden the LCDOUT command is at fault and doesn't work.

    LCDOUT works perfectly fine for its intended purposes. You're trying to use it for something it was not designed for and because that doesn't work the way you'd like the command is flawed, is that correct?

    Apart from editing the custom characters to not include $FE and/or writing your own routines to drive the display I don't have any ideas.

  6. #6
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    Well, I have shifted letters to right edge, instead of left, and for text it indeed works, but when there is need to display the graphics...
    I'm using LCDOUT due it's simplicity and low memory use.
    The code below occupies less than 1k of memory (font data stored in eeprom), and allows you to have 4 lines X 18 characters text display with all custom letters on graphical display.

    Code:
    C=0 '0=1st line, 8=2nd line, 16=3rd line and 24=4th line 
    arraywrite topline, ["place text here   "]
    GOSUB GCODER
    stop
    
    
    
    
    GCODER:
    FOR X=0 TO 17 step 2	'READ ARRAY INTO VARIABLE, ARRAY MEMBER CHAR=EEPROM OFFSET	
    Y=(topline[x]-65)*8
    Z=(topline[x+1]-65)*8 'READ  INTO VARIABLE AS TWINS
    FOR I=0 TO 7	'HELPER LOOP FOR CHARACTER READING
    READ Y+I,A 'READ EEPROM BYTES INTO VAR
    READ Z+I,B
    LCDOUT $FE,$80+i+c 'UPDATE Y POSITION
    LCDOUT $FE,$80+x/2 'UPDATE X POSITION
    if topline[x]=32 then a=0
    if topline[x+1]=32 then b=0 'blanker
    LCDOUT a
    LCDOUT b 'WRITE TO SCREEN
    'pause 10
    NEXT I
    NEXT X
    return

Similar Threads

  1. DS3231 works in one config, but does not works with other IC.
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd December 2019, 20:52
  2. Alternate If-Then Statement Help
    By pdegior in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th August 2007, 01:07
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 19:05
  4. 8bit LCDout vs 4bit LCDout
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th May 2006, 13:16
  5. A simple IF Statement!!!!
    By mslaney in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 17th February 2005, 21:58

Members who have read this thread : 0

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