Creating a Custom LCD Character in MikroC PRO for PIC

By , February 13, 2010 7:30 pm

In this video I demonstrate how to create a custom LCD character using MikroC Pro for PIC and the EasyPIC Development board by MikroElektronika http://www.mikroe.com . The microcontroller used in this tutorial is the Microchip PIC18F4685.

Here is the source code for the project:

I_heart_mikroC_Project.zip

10 Responses to “Creating a Custom LCD Character in MikroC PRO for PIC”

  1. Thats a nice little video, very informative and the code for it too, awesome. :)

  2. Mohamed Omar says:

    Thanks .

  3. Ahmed Lazreg says:

    Hi,
    you can also use GLCD Font Creator MikroElektronika edition. It can also generate and let you create custom char projects for HD44780 controller.

  4. Filip says:

    Great tutorial! Keep it going. Looking forward for more!

  5. me me says:

    hello there, how can i do this on a 128 x64 lcd, it doesnt have any custom charcter function. i use mikro C 8.2 and pic 18f4550.

  6. Andrew says:

    My suggestion for you would be to look into the free MikroElektronika GLCD Font Creator to create characters for 128x64 GLCDs.

  7. Siarhey says:

    This function CustomCharacter doesn't work two times.

    void CustomChar(char pos_row, char pos_char,int n) {
    short i;
    Lcd_Cmd(64);
    for (i = 0; i<=7; i++) Lcd_Chr_CP(character[n][i]);
    Lcd_Cmd(_LCD_RETURN_HOME);
    Lcd_Chr(pos_row, pos_char, 0);
    }

    This string below doesn't work correctly:
    CustomChar(1,3,2);
    CustomChar(1,4,4);

  8. Andrew says:

    Hi Siarhey.

    MikroElektronika has a great tech support team that I have found really helpful. They could probably answer your question better than I can.

    I don't have my easyPIC dev board near by right now to try this out but as a work-around to your issue you might try something like making a copy of the CustomChar function with a unique name like CustomCharA and CustomCharB and see if it responds differently.


    const char characterA[] = {0,10,31,31,14,4,0,0};
    const char characterB[] = {0,10,31,31,14,4,0,0};

    void CustomCharA(char pos_row, char pos_char) {
    char i;
    LCD_Cmd(64);
    for (i = 0; i<=7; i++) LCD_Chr_Cp(characterA[i]);
    LCD_Cmd(_LCD_RETURN_HOME);
    LCD_Chr(pos_row, pos_char, 0);
    }

    void CustomCharB(char pos_row, char pos_char) {
    char i;
    LCD_Cmd(64);
    for (i = 0; i<=7; i++) LCD_Chr_Cp(characterB[i]);
    LCD_Cmd(_LCD_RETURN_HOME);
    LCD_Chr(pos_row, pos_char, 0);
    }

    Then try using the following commands:

    CustomCharA(1,6);
    CustomCharB(2,6);

    Good Luck!

    Regards,
    Andrew

  9. anna says:

    I wanted to ask is it possible to make text only in the second row shift left and right while the text in the first row remains?

  10. Andrew says:

    Hi Anna.

    It has been a while since I have used a traditional 16x2 LCD screen with MikroC Pro for PIC.

    Here is a link to the MikroC Pro for PIC - LCD Library page. In their library example they demonstrate the _LCD_SHIFT_LEFT and _LCD_SHIFT_RIGHT Lcd Commands.

    If you are not satisfied with the results from the MikroC shift commands you could create your own Circular Buffer array that would allow you to scroll text independently on either LCD row.

    Regards,
    Andrew Hazelden

Leave a Reply

Note: Comments will have spelling errors corrected before they are posted. If you have a specific question please provide your email address so I can send you a direct reply.