Proton BASIC Compiler - Alpha LCD Only 8 characters displayed


  • PicŪ Basic


  • Alpha LCD Only 8 characters displayed

    All Alpha LCD 2x16 are expected to print all 16 characters per line. But it happens that only the first 8 characters are effectively displayed using PROTON.

    This is even nearly always the case with actual 1x16 LCD's.

    Is this a bug of PROTON?

    Not at all. This happens because all alpha LCD's, although being quite looking the same, do not necessarily use the exact same controller.

    PROTON expects a HITACHI 44780 controller. But some manufacturers used a slightly different type of controller, or use a 2x16 controller to build 1x16 LCD's. In this case, the 8 first characters are viewed as LINE 1 and the 8 next are viewed as LINE 2 as the mapping of the characters displayed on the screen is not the same as the original one.

    Do not discard this type of LCD. They work fine. The solution resides in a slight adaptation of your code.

    Example Code

    ' Example of 16 caracters displayed on a 'strange' LCD

    'First declare them as 2 lines:

    DECLARE LCD_INTERFACE 4
    DECLARE LCD_LINES 2
    DECLARE LCD_DTPIN PORTB.0
    DECLARE LCD_ENPIN PORTB.4
    DECLARE LCD_RSPIN PORTB.5

    'Then manage to print your data on two lines of 8 characters:

    PRINT AT 1,1, "12345678"
    PRINT AT 2.1, "ABCDEFGH"

    'This will display: "12345678ABCDEFGH"
    contributed by Olivier.
  • Recent Activity

    towlerg-21522

    The Proton manual

    Thread Starter: towlerg

    I don't know if it's just me but I don't seem to be able to paste examples from the PDF. I'm sure I could at some time in the past but maybe I'm...

    towlerg Today, 21:07 Go to last post
    top204-15

    SD File System revisited

    Thread Starter: AlbertoFS

    I have reviewed the SD_File_System in a file.inc only checking all macros using the preprocessor too. I have tried to make the commands easier to...

    top204 Today, 13:14 Go to last post