LCD_VARIANT

Using LCD_VARIANT:

Some LCDs are non-standard.   The non-standard LCDs may have a different memory architecture where the memory is non-consective or different delay timing is required for the LCD IC.   Use LCD_VARIANT to change the operating behaviour of GCBASIC with respect to LCD operations.   If a LCD_VARIANT adaption has been created in the library then the non-standard LCD can be supported.

#DEFINE LCD_VARIANT 1601a

Use #define LCD_VARIANT 1601a to use this sub variant. Requires a LCD_IO then this sub type modifier.   This variant has a non consective memory as shown in the diagram below.

graphic

Example:

This example shows how to use the LCD_VARIANT constant.   This example shows the use of software I2C - any LCD mode can be used not just software I2C.  

    #chip tiny84,1

    'Set up LCD
    #define LCD_IO 10
    #define LCD_VARIANT 1601a          ' <<< the constant this page documents
    #define LCD_WIDTH 16

    'You may need to use SLOW or MEDIUM if your LCD is a slower device.
    #define LCD_SPEED FAST

    ' ----- Define Hardware settings
    ' Define I2C settings - CHANGE PORTS FOR YOUR NEEDS
    #define LCD_I2C_Address 0x0E
    #define I2C_MODE Master
    #define I2C_DATA PORTA.4
    #define I2C_CLOCK PORTA.5
    #define I2C_DISABLE_INTERRUPTS ON

    'You may need to invert these states. Dependent of LCD I2C adapter.
    #define LCD_Backlight_On_State  1
    #define LCD_Backlight_Off_State 0

    ; ----- Main body of program commences here.
    Locate 0,0
    PRINT "GCBASIC"


    Do
    Loop

Key line: #define LCD_VARIANT 1601a — selects the non-standard memory-map adaptation for this specific LCD sub-type; it is layered on top of the chosen LCD_IO connection mode (here LCD_IO 10, I2C via a PCF8574 expander), not a replacement for it.

For code examples see I2C Variants LCD Solutions.

See the separate sections of the Help file for the specifics of each Connection Mode.

See Also: