Replacing array member on the fly (big LCD characters idea)


Closed Thread
Results 1 to 38 of 38

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Yes, there are 8 custom characters and char #255 - Full block is used.

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


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Here's 2x2 font for 1602 OLED (Here you can write bytes directly, not limited by 8 custom chars).

    Name:  picbasical.jpg
Views: 11953
Size:  63.5 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Wanted to store above font in EEPROM. each character takes 2x13 bytes. so 260 byte of memory are needed, but most chips have only 256 bytes of eeprom available.
    I come up with run length encoding compression idea. Since there are only 5 bits used, can use remaining 3 as a counter, showing how many times current pattern should be repeated. This gives ability to repeat up to 8 positions

    Say for character 4 (top left part), in "normal" mode, bit pattern looks like this: %11000. But if we add %110 to end of it, so it now looks like %11000110, decoder software will know that it have to repeat that pattern 6 times.

    So code for reading and decoding char to appropriate DDRAM or whatever it is called, should work like this:

    1. Set pointer address from which the bitmap should be read.
    2. Read it, if 3 last bits<>0 then separate it, and do the loop, writing the code of first 5 bits, repeating them times specified in these 3 bits.
    3. Continue reading of bitmap as needed.

    But I have issue with statement for dividing bit variable into two. Say I have %10101010. How should I divide it into two variables, one which has 5 bits from left, and another having 3 bits from right?

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Quote Originally Posted by CuriousOne View Post
    But I have issue with statement for dividing bit variable into two. Say I have %10101010. How should I divide it into two variables, one which has 5 bits from left, and another having 3 bits from right?
    Something like this?

    Code:
    byte_var    var byte
    a_left         var byte
    b_left         var byte
    
    byte_var=%10101010
    a_left=byte_var & %11111000
    b_left=byte_var & %00000111
    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Yes, but I was thinking about either <<, >> or DIG() operators...

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    then combine accordingly like that:

    Code:
    a_left=(byte_var & %11111000)>>3
    to make it right justified if needed.

    Ioannis

  7. #7
    Join Date
    Feb 2013
    Posts
    1,149


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Found interesting thing. On power up, custom character area in normal LCD are empty, but on WS0010 OLED displays, they are filled with random numbers on power up.

  8. #8
    Join Date
    Feb 2013
    Posts
    1,149


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Just did a rough estimation - the above idea should save 30-40% of EEPROM space. Not bad.

  9. #9
    Join Date
    Feb 2013
    Posts
    1,149


    Did you find this post helpful? Yes | No

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Also it is possible to separate and replace some similar blocks with additional indexes - this should save additional 10-20%...

Similar Threads

  1. String of characters(array) to decimal value
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th June 2012, 14:30
  2. write big text to lcd
    By isaac in forum General
    Replies: 3
    Last Post: - 8th October 2008, 01:45
  3. Big big big memory or tiny SDs!
    By Ron Marcus in forum Off Topic
    Replies: 9
    Last Post: - 25th May 2007, 18:02
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  5. Replacing an ARRAY with EEPROM write to save space?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th March 2005, 18:31

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