Serial LCD is Killing Me! Just garbage


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    This is the Basic Stamp 2 sample you can find in your LCD manual.

    Changes for PBP:

    - SEROUT Pin,Mode,[Item{,Item...}]
    Mode is 6 (9600 Driven Inverted)

    - Declare variable b2
    b2 VAR byte

    Serial LCD manual:
    http://www.seetron.com/pdf/bpp423.pdf

    In order to run the sample code below you will have to set the
    DIP Switch of the LCD module as following:

    1=OFF (Normal mode)
    2=ON (9600 baud)

    Regards,

    Luciano

    Code:
    ' Program: 420DEMO.BS2 (Demonstrate 4x20 Serial LCD with Stamp II)
    ' This program demonstrates many of the features of the 4x20 Serial
    ' LCD Module from Scott Edwards Electronics. Set the module to
    ' 9600 bps (S1: switch 1 down; 2 up). Connect the serial input
    ' of the module to BS2 pin P0, GND to GND and +5V to +5V.
    ' Run this program.
    ' =========Define names for LCD instructions, bps=======
    noCurs con 4 ' Make cursor invisible.
    ulCurs con 5 ' Show underline cursor.
    clrLCD con 12 ' Clear entire LCD screen.
    posCmd con 16 ' Position cursor.
    clrCol con 17 ' Clear column.
    wedge con 128 ' Wedge-shaped symbol.
    bigNums con 2 ' Begin big numbers.
    N9600 con $4054 ' Baudmode for inverted, 9600-bps output.
    ' The constants "bell" and "bksp" are predefined in PBASIC2.
    ' =================Begin demonstration=================
    pause 1000
    
    serout 0,N9600,[clrLCD] ' Clear the screen.
    
    for b2 = 0 to 79
      serout 0,N9600,[wedge] ' Fill screen with wedges.
    next
    
    pause 1000 ' Wait 1 second.
    
    serout 0,N9600,[posCmd,68] ' Move to position 4 (64+4= 68).
    
    for b2 = 1 to 12 ' Clear a 12-character swath with
      pause 350 ' ...the clear-column feature.
      serout 0,N9600,[clrCol,bell] ' Ring bell (if available) each loop.
    next
    
    ' Turn on the underline cursor, move to pos. 26, and show message.
    serout 0,N9600,[ulCurs,posCmd,90,"4x20 LCD"]
    
    pause 1000 ' Wait 1 second.
    
    for b2 = 1 to 8
      pause 100 ' Backspace to erase message.
      serout 0,N9600,[bksp,bell] ' Ring bell (if available) each loop.
    next
    
    pause 1000 ' Wait 1 second.
    
    serout 0,N9600,[noCurs] ' Turn cursor off.
    
    ' Print the numbers 0 to 99 in big numbers in the middle of
    ' the screen. Pause a half second between numbers.
    
    for b2 = 0 to 99
      serout 0,N9600,[posCmd,70,bigNums,dec b2]
      pause 500
    next
    
    END ' Finished.

  2. #2
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    Thank you guys!
    In the meantime, i took a long fast ride on my motorcycle and came back with a clear head. I got it working...
    All this time I was looking in the manual when I should have been looking at the datasheet.
    When I get to trying to make the code more elegant, I'll be back!
    Thanks.

Similar Threads

  1. LCD serial backpacks
    By Archangel in forum Serial
    Replies: 67
    Last Post: - 30th December 2010, 05:51
  2. Please help with EDE702 - Serial to LCD interface
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th October 2008, 03:48
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. Serial LCD
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th November 2007, 09:31
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts