Shop OBEX P1 Docs P2 Docs Learn Events
pseudo 1-line lcds and the BS2 — Parallax Forums

pseudo 1-line lcds and the BS2

ArchiverArchiver Posts: 46,084
edited 2002-03-01 16:37 in General Discussion
I purchased some LCD's recently. I just learned they are pseudo 1-
line LCDs (see Scott Edwards stamp book pp. 187)
I am having a problem with writing past the 7th character on a 1x16
lcd that is organized as a 2x8 screen. I have the lcd initilized as
a 2 line display and I can see all character positions, but I need a
programming example to write the 8th character. Do I just
program "char = $C0", then the character code, then "LOW RS". I have
tried changing DDRam to C0, but my program still writes to the first
character.

Be aware when you purchase a "bargan" lcd at a flea market, these
pseudo 1-line LCD's are a pain to program with.
THANKS
Mike

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-03-01 16:37
    Mike
    I hope this can help you

    '{$STAMP BS2SX}
    'BS2sx to HD44780 LCD, using 4+2 pins

    'BS2sx to LCD
    'bit0 > pin11 = bit4
    'bit1 > pin12 = bit5
    'bit2 > pin13 = bit6
    'bit3 > pin14 = bit7
    'bit4 > pin04 = select
    'bit5 > pin06 = enable
    ' pin05 = R/W = Vss
    ' pin01 = Vss
    ' pin02 = Vdd
    ' pin03 = contrast

    char var byte 'character to write
    indx var nib

    Msg DATA " PARALLAX BS2sx " 'message

    init:
    DIRL = %00111111 '6 LSB = outputs
    pause 500
    OUTL = %000011 'Initialize by
    pulsout 5,50 'sending this pattern
    pause 5 '3 times for 40 µS
    pulsout 5,50
    pulsout 5,60
    OUTL = %0010 'Function set:4bits
    pulsout 5,50
    char = %00101000 '2 lines
    gosub comm
    char = %00001110 'disp on,cursor on,blink off
    'char = %00001101 'or disp on,cursor off,blink on
    gosub comm
    char = %00000110 'set increment,no shift
    gosub comm

    outmsg: 'subroutine to show a message
    char = %00000010 'cursor home 1st block
    gosub comm
    for indx = 0 to 15 'get message from EEPROM
    read (Msg + indx),char 'read a character
    gosub writ 'write it
    if indx <> 7 then nxtc
    char = %11000000 'cursor home 2nd block
    gosub comm
    nxtc:
    next
    pause 1000

    clear: 'subroutine to clear the screen
    char = %00000001 'clear the display
    gosub comm

    loop: 'subroutine to get and show a line
    char = %00000010 'cursor home 1st block
    gosub comm
    for indx = 0 to 15
    serin 16,240,[noparse][[/noparse]char] 'get a character from PC
    if char=$0D then clear 'if CR then clear screen
    gosub writ 'write it on LCD
    if indx <> 7 then nxtcc
    char = %11000000 'cursor home 2nd block
    gosub comm
    nxtcc:
    next
    goto loop 'redo

    comm: 'subroutine to send a command
    OUT4 = 0 'select instructions
    writ: 'subroutine to show a character
    OUTA = char.highnib 'put high nibble in output
    pulsout 5,50 'enable for 40µS
    OUTA = char.lownib 'put low nibble in output
    pulsout 5,50 'enable for 40µS
    OUT4 = 1 'select characters
    return

    Original Message
    From: "mdelaney14" <mdelaney14@e...>
    >
    > I purchased some LCD's recently. I just learned they are pseudo 1-
    > line LCDs (see Scott Edwards stamp book pp. 187)
    > I am having a problem with writing past the 7th character on a 1x16
    > lcd that is organized as a 2x8 screen. I have the lcd initilized as
    > a 2 line display and I can see all character positions, but I need a
    > programming example to write the 8th character. Do I just
    > program "char = $C0", then the character code, then "LOW RS". I have
    > tried changing DDRam to C0, but my program still writes to the first
    > character.
    >
    > Be aware when you purchase a "bargan" lcd at a flea market, these
    > pseudo 1-line LCD's are a pain to program with.
    > THANKS
    > Mike
Sign In or Register to comment.