How to move data from array into LCD? (Using LCDOUT)


Closed Thread
Results 1 to 19 of 19

Hybrid View

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

    Default How to move data from array into LCD? (Using LCDOUT)

    Hello. I have certain project, it uses a lot of custom characters, and they need to be changed frequently. I've already learned how to read data from eeprom into array, but I'd like to somehow mate array and LCDOUT, so I can slide-in out data, to create visual effects, any idea?

    I'm asking for this:

    Code:
    lcdout $fe,$40, $e, $11, $12, $14, $1e, $11, $11, $12
    How to replace hex data here with dynamic data from array?

    Just in theory, how I see this code in some idealistic BASIC:

    Code:
    DIM GRAPH(8) 'define array with 8 lines
    GRAPH(1)=$FE 
    GRAPH(2)=$CO ' and so on, example of data in array
    For A=0 to 7 ' loop till 8
    LCDOUT $FE, $40+A, GRAPH(A) - write bytes to LCD memory
    NEXT A
    But of course, above won't work in PBP.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    Section 5.38, LCDOUT:
    STR ArrayVar{\count} Send string of n characters
    Then of course if you want to do it in the idealistic BASIC way
    Code:
    Graph[0] = $11
    Graph[1] = $23
    'and so on.
    LCDOUT $FE, 1   'Clear the screen
    For i = 0 to 7
      LCDOUT Graph[i]
    NEXT
    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    With LCDOUT, I don't want to put new characters on screen, I want to update LCD screen custom character RAM, so process of char redrawing will be shown as animation.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    What's the difference between writing to DDRAM and CGRAM? Instead of sending the clearscreen command as in the example, send the correct command to access CGRAM and then the data.

    /Henrik.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    The question is in following. Say, first character RAM starts at $40. And this is address for top line, right? and address for next line is $41 ? I mean, if I do code, where $40 will be incremented by 1 in loop for 7 times, all lines will be written properly?

    Code:
    LCDOUT $FE, $40+A,
    is such structure correct?

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    The adress pointer in the 44780 is incremented automatically so if you set it to $40 and send 5 bytes of data they will end up at adress $40-$44 automatically. Just as they would when you write to the DDRAM, you (for example) clear the screen which sets the adress pointer to 0 (first char on first line). Each byte received from there on will end up at "the next" location, right? There's no difference in writing to CGRAM. So if you prefer your idealistic way over using the STR modifer
    Code:
    LCDOUT $FE, $40  ' Set adress pointer to first location of CGRAM
    For i = 0 to 7        ' Send 8 bytes of CG data
      LCDOUT Graph[i]
    NEXT
    At least give it a try and see if it does what you're asking.

    /Henrik.

  7. #7
    Join Date
    Aug 2016
    Posts
    22


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    I think efm8 microcontroller would be helpful.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    In what way exactly would an EFM8 microcontroller help the OP with his question reagarding using the PBP cpmmand LCDOUT on a PIC microcontroller? Please explain because I don't understand.

    I don't know if you're actaully TRYING to help or just plain out trolling but you do realise that this forum is mainly for discussing PICs and specifically the PBP compiler from MicroEngineeringLabs don't you?

    You've been here a month, haven't asked a single question (that's totally fine) or given a single answer to anything pertaining to the forum topic. You continue to post totally unrelated links to sites about CCS, Perl, C++, other microcontroller or just plain out spam. I don't get it.

    If you really ARE here to discuss PBP and the use of it please accept my appologies for jumping on you but if my feeling is right and you don't even know what PBP is please educate yourself and then stick to the forum topics and stop posting nonsense.

    /Henrik.

  9. #9
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: How to move data from array into LCD? (Using LCDOUT)

    Quote Originally Posted by HenrikOlsson View Post
    In what way exactly would an EFM8 microcontroller help the OP with his question reagarding using the PBP cpmmand LCDOUT on a PIC microcontroller? Please explain because I don't understand.

    I don't know if you're actaully TRYING to help or just plain out trolling but you do realise that this forum is mainly for discussing PICs and specifically the PBP compiler from MicroEngineeringLabs don't you?

    You've been here a month, haven't asked a single question (that's totally fine) or given a single answer to anything pertaining to the forum topic. You continue to post totally unrelated links to sites about CCS, Perl, C++, other microcontroller or just plain out spam. I don't get it.

    If you really ARE here to discuss PBP and the use of it please accept my appologies for jumping on you but if my feeling is right and you don't even know what PBP is please educate yourself and then stick to the forum topics and stop posting nonsense.

    /Henrik.
    Well said Henrik

Similar Threads

  1. How to get ASCII data in array.
    By Ioannis in forum Serial
    Replies: 8
    Last Post: - 6th November 2008, 20:14
  2. LCD without LCDOUT command
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th August 2007, 14:22
  3. Array data being corrupted
    By caverman in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th March 2006, 04:22
  4. Larger array possible if I move to 18Fxxx?
    By incognico in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd January 2006, 15:03
  5. lcdout define each data pin
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th October 2005, 19:59

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