LCD Creator for Mac OSX

Discussion in 'Embedded Systems and Microcontrollers' started by portreathbeach, Jun 8, 2014.

  1. portreathbeach

    Thread Starter Active Member

    Mar 7, 2010
    143
    5
    After searching the web for some software for creating C code arrays for graphical LCDs for the Mac and finding none, I decided to have a go at writing my own.

    It is written mainly for exporting code for use with a Nokia 5110 LCD module, but may work for other LCDs. I haven't actually experimented with my LCD module yet, but the exported C array should work if using horizontal addressing mode on the LCD.

    Anyway, here's a screen shot and a link to download the software.

    [​IMG]


    http://www.csmithsoftware.com/LCD_Creator/LCD_Creator.dmg


    This is my first attempt, and any comments about improvement are welcome.
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I would add two edit boxes to allow the user to input X and Y offset.

    That lets them import a smaller image (or icon etc) and position it on the display. Or centre a Logo image that is smaller than the display size.

    And the option to invert the bitmap.
    :)
     
  3. portreathbeach

    Thread Starter Active Member

    Mar 7, 2010
    143
    5
    Hi,

    I'll have a look into this. I did expect that if someone wanted a centred image, they would make the bitmap to the size of their screen with the image where they want it.

    I was trying to keep it pretty simple, so if you load a small bitmap into the program, it generates a smaller C array, so not needing to load the entire screen, just a small part of it with the offset coded into the compiler, maybe good for making icons, fonts and possibly sprites for a game.

    The 'invert' option would be pretty easy to implement.

    Thanks for the comment, I'll have a play with my Nokia 5110 module and see what else I can come up with. :)
     
    Last edited: Jun 8, 2014
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    What about adding other display sizes?

    128*64 GLCD is very popular too. :)
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    Back when I was dong B&W displays I had two vital structures: bitmaps and fonts. Note this was for the C18 compiler which makes strong distinctions between RAM and ROM variables.

    My bitmap starts as defined as yours seems to be: a contiguous stream of 1's and 0's that fill the area; at most there would be 7 unused bits in the last byte. But mine also adds width and height information as it is the rare exception I wanted to paint the entire screen. Mostly I would be doing buttons or other icons, so I used the following structure:

    Code ( (Unknown Language)):
    1. typedef struct
    2. {
    3.     rom char bmpWidth;           // width in pixels
    4.     rom char bmpHeight;          // height in pixels
    5.     rom char *bitsBitmap;        // first byte of ROM bitmap
    6. } rom_bitmap;
    Since there are no defined letters you need create your own. Fonts were defined similar to bitmaps except each letter was it's own individual bitmap to make parsing the letter bitmap array easier:
    Code ( (Unknown Language)):
    1. typedef struct
    2. {
    3.     const rom char FirstFont;            // first ASCII symbol defined
    4.     const rom char LastFont;             // last ASCII symbol defined
    5.     const rom char DefaultFont;          // If nothing available...
    6.     const rom char FontWidth;            // font width in pixels
    7.     const rom char FontHeight;           // font height in pixels
    8.     const rom char BytesPerCharacter;    // bytecount for a single character
    9.     const rom char *Bitmap;              // first byte of ROM bitmap
    10. } font;
    I don't have any examples of bitmaps handy, but here are the fonts as I used them.
     
  6. portreathbeach

    Thread Starter Active Member

    Mar 7, 2010
    143
    5
    Hi, The_RB. You can load any size bitmap into the software and it will output the C array. I've tried up to 640x480, which took about 5 seconds to create the array. In theory, any size can be used, just depends how long you want to wait for the conversion to take.
     
  7. portreathbeach

    Thread Starter Active Member

    Mar 7, 2010
    143
    5
    Just a little update. As I am getting a 1.8" TTF RGB module, I decided to add a couple of extra options to LCD Creator.

    You can choose from:

    - Nokia 5110 (which outputs for horizontal addressing)
    - ST7735 (1 bit per pixel) (vertical addressing)
    - ST7735 (16 bit) (vertical addressed 16 bit RGB565 colour)


    Haven't got my colour module yet, but in theory it will work.

    [​IMG]

    The download is in a thread above.
     
Loading...