Shop OBEX P1 Docs P2 Docs Learn Events
lcd4x20 display — Parallax Forums

lcd4x20 display

HED GROUPHED GROUP Posts: 15
edited 2009-04-21 00:13 in Propeller 1
{{ Hi to everybody I,m and enginer, new in the propeler chip I,m working with the
lcd 27979. I,m try to control using serial_lcd and the simple_serial objects
can somebody tell me why the fallowing method dont turn on and off the backlight
light and also I can,t manage any command in lcd display.
THANKS IN ADVANCE.
}}
OBJ
· LCD : "SERIAL_LCD"
· SERIAL : "SIMPLE_SERIAL"
PUB INIT
SERIAL.init(0, 0, 9600)
LCD.init(0,9600, 4)
LCD.DISPLAYON ' Display on
REPEAT
·LCD.BACKLIGHT(1) ' Backljght on
·WAITCNT(12_000_000 + CNT)
·LCD.BACKLIGHT(0)' Backljght off
·WAITCNT(12_000_000 + CNT)

Comments

  • mparkmpark Posts: 1,305
    edited 2009-02-27 01:51
    Is that your whole program? One problem is that you're not specifying the clock speed. Try adding the following (assuming you're using a 5MHz crystal):
    con
    _clkmode = xtal1+pll16x
    _xinfreq = 5_000_000
    
    
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2009-02-27 01:59
    In the Prop library there is a Demo_LCD_Test program in Spin. I'm not sure if it's the same LCD module but sometimes it's easier to modify a program then go from the ground up.
    Welcome to the forum, Good luck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent, only $1.
    Send cash and signature to CannibalRobotics.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2009-02-27 02:01
    Oops, you might also look at the prop object exchange. I've found all sorts of great code there....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent, only $1.
    Send cash and signature to CannibalRobotics.
  • Greg LaPollaGreg LaPolla Posts: 323
    edited 2009-02-27 05:50
    You dont need the simple serial as it will be called by the Serial_Lcd object.

    Try this
    OBJ
      LCD : "SERIAL_LCD"
    
    PUB INIT
      LCD.init(0,9600, 4)
      REPEAT
        LCD.backlight(true) ' Backljght on
        WAITCNT(12_000_000 + CNT)
        LCD.backlight(false)' Backljght off
        WAITCNT(12_000_000 + CNT)
    
    



    there may or may not be issues with your waitcnt statements. The above should work!
  • johnedjohned Posts: 2
    edited 2009-04-20 20:24
    I have done a quick scan of the forums and I don't see any existing code or questions about the 4x20+ keypad LCD module (parallax 30058 = Matrix orbital LK204-25) the existing OBEX serial LCD code looks to be transmit only and for the other 3 Parallax serial displays. Anyone with experience on this one???
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-04-20 21:49
    I have issues communicating with the serial LCD as well. I would check to see if the LCD is communicating at 9600 baud (the switches on the back specify this). Also, can you try it to transmit any characters just to see if the baud is right? Make sure the Serial backpack is connected correctly to the display, and that the cursor shows when you connect power whether it is connected to the Propeller or not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontrolled.
  • mikedivmikediv Posts: 825
    edited 2009-04-21 00:13
    Hey guys I have the same display I am using it with my propstick here is some code that was given to me to try and it works I made a few mods to see how things work but it will work as is , just use pin 15 as the output to the screen and it works great

    ______________________________________________________________
    CON
    'These are clock constants
    _xinfreq = 5_000_000
    _clkmode = xtal1 | pll16x
    pinLCD = 15 ' Pin 15 is the output to the LCD I then just connected +5 and ground this turns the backlight on as well

    OBJ
    LCD : "FullDuplexSerialPlus" ' fullduplexserial works just fine as well I used fullduplexserialplus because of something else I was doing but either works just fine


    PUB StartLCD

    LCD.start(24, pinLCD, 0, 19200) 'NOTE THE 24 as receive Pin UNTESTED AND UNNEEDED?

    LCD.tx(12) 'clear

    waitcnt((clkfreq/1000)*7+cnt)
    'repeat 10
    LCD.tx(17) 'backlight
    LCD.tx(22) 'No cursor
    LCD.str(string("Hello Mike ."))
    LCD.tx(17) 'This activates the back light
    LCD.tx(18)
    LCD.str(string("hope this prints"))
    LCD.tx(17) ' I had to add this command to keep the backlight on

    repeat

    _____________________________________________________________________________________
Sign In or Register to comment.