+ Reply to Thread
Results 1 to 17 of 17

Thread: Parallax 4x16 LCD Help

  1. #1

    Default Parallax 4x16 LCD Help

    Hello


    i have a parallax 4x16 lcd and i have it working but i need to know how tosend text to the lcd. i currently have the Debug_LCD Driver but it seems to nothave the ability to send a fill string to the screen.
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  2. #2

    Default Re: Parallax 4x16 LCD Help

    It would be nice if we knew some more details... Is the LCD serial or parallel interfaced? What microcontroller are you using(I assume a Stamp?). How are you powering your board? What software are you using? Are you missing external components?.. We will be shooting in the dark until we can get some specifics
    I got the best hair around...Guaranteed!

  3. #3

    Default Re: Parallax 4x16 LCD Help

    Hello

    Sorry for the lack of information, the project is developed on the propeller chip and i am using a propeller demo board.

    CODE BELOW

    Code:
     
    {{
      RFID Tag Side (remote client)
    }}
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
      XBEE_DOUT_PIN = 1
      XBEE_DIN_PIN  = 2
      XBEE_MODE     = %0000
      XBEE_BAUD     = 9_600
      LED_PIN       = 20
      
      LCD_PIN       = 3                                         ' for Parallax 4x20 serial LCD on P0
      LCD_BAUD      = 19_200
      LCD_LINES     = 4 
      
    obj
      xb    :       "FullDuplexSerial"  'comms to XBee.
      xbobj :       "XBee_Object_2"
      lcd   :       "debug_lcd"
      pst   :       "Parallax Serial Terminal"                   ' Serial communication object      
    var
      long  recv
      byte data[11]  
      
    pub go | idx
      xb.start(XBEE_DOUT_PIN, XBEE_DIN_PIN, XBEE_MODE, XBEE_BAUD) 'start comms to XBee
      pst.Startrxtx(1, 30, 0, 9600)' Notice pin 0 is the Rx pin on this end. Pin 30 is used for transmitting to the serial terminal
           
        if lcd.init(LCD_PIN, LCD_BAUD, LCD_LINES)             ' start lcd
          lcd.cursor(0)                                       ' cursor off
          lcd.backLight(true)                                 ' backlight on (if available)
          lcd.custom(0, @Bullet)                              ' create custom character 0
          lcd.cls                                             ' clear the lcd
          lcd.str(string("NODE", 13))
          lcd.putc(0)                                         ' display custom bullet character
          lcd.str(string("Recive", 13))
          lcd.putc(0)
          lcd.str(string("Transmit", 13)) 
          lcd.putc(0)
          'main loop
            repeat
              ReciveData
               
    
    pub ReciveData
        pst.strinmax(@data, 1)
        waitcnt(clkfreq/100 + cnt)
        updateLcd(@data) 
        pst.str(@data)
      
    pub Delay(mS)       ' Delay in milliseconds
     
       waitcnt(clkfreq / 1000 * mS + cnt)
    PRI updateLcd(value)
      lcd.gotoxy(12, 1)
      lcd.str(value)                                    ' print right-justified decimal value
      lcd.gotoxy(12, 2)
      lcd.str(value)                                 ' print indicated (with $) hex
    
    DAT
      Bullet      byte      $00, $04, $0E, $1F, $0E, $04, $00, $00
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  4. #4

    Default Re: Parallax 4x16 LCD Help

    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  5. #5

    Default Re: Parallax 4x16 LCD Help

    Mhhh. Did you mean 4x20? I didn't see any 4x16's on the Parallax website? The only 4x20 display that Parallax sells has a serial interface, so that takes care of that question. Serial displays are much easier to deal with... Could you upload your code? That would go a long way! Also, try messing around with the contrast pot and see if that helps at all...

    I was just typing this as you posted the datasheet
    I got the best hair around...Guaranteed!

  6. #6

    Default Re: Parallax 4x16 LCD Help

    sorry yes it is the 4x20 i was half asleep when i opened this post.
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  7. #7

    Default Re: Parallax 4x16 LCD Help

    Most Parallax serial LCD's have a built in "splash screen" that will show up on the display by simply powering up the device and flipping the baud mode switches down to the default setting(test).. You should do that first to test to see if the module even works at all..
    I got the best hair around...Guaranteed!

  8. #8

    Default Re: Parallax 4x16 LCD Help

    It works , i have all of the code from my above post working but when i pass my variable to the update lcd function and back to the lcd i only get 1 character instead of my whole string. and i am using the string function.

    CODE SNIPPET

    Code:
    PRI updateLcd(value)
      lcd.gotoxy(12, 1)
      lcd.str(value)                                    ' print right-justified decimal value
      lcd.gotoxy(12, 2)
      lcd.str(value)                                 ' print indicated (with $) he
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  9. #9

    Default Re: Parallax 4x16 LCD Help

    Gotcha.... Strings/ arrays of data have to be passed with a "@" symbol or else it will not be recognized as a string of text.. So stick the @ right before the value. Like such
    Lcd.str(@Value)


    Or if you want to insert a string of text without a variable array, you could do this..

    Lcd.str(string("What hath God wrought?"))



    OR... Were you trying to display a decimal number as a value? If so, then you would need to change the line of code so that it will display a single byte/word/long of data as a ASCII string.. Like such

    Lcd.dec(value)
    Last edited by Ravenkallen; 05-20-2011 at 03:30 PM.
    I got the best hair around...Guaranteed!

  10. #10

    Default Re: Parallax 4x16 LCD Help

    When i put the @ in front of the variable it only send 1 character at a time i would like to send the whole string at once.
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  11. #11

    Default Re: Parallax 4x16 LCD Help

    I think what you want is to send a decimal value to the LCD... ignore the first bit of what i said. Did you try the..

    lcd.dec(value)

    That should give you what you want... Yeah, i thought that you wanted to do was send a string of characters from an array to the LCD. You just want to display a byte of data as a ascii string. The above should work. Sorry for the confusion
    I got the best hair around...Guaranteed!

  12. #12

    Default Re: Parallax 4x16 LCD Help

    This sends a decimal value to the lcd i need to send a string so do i need to convert this string ?
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  13. #13

    Default Re: Parallax 4x16 LCD Help

    Post the code, with the string handling portion.

    Consider a string is only a byte array, with the end of the sting identified by a 0. A "string" function returnd directly the address, and this is expected by the sting handling functions.
    If you have the string in a DAT section you should use the @, same if you create a string as an array.

    if you send

    lcd.str(string("hello"))

    does it work?

    Massimo

  14. #14

    Default Re: Parallax 4x16 LCD Help

    Yes, it works thanks a bunch Massimo
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

  15. #15

    Default Re: Parallax 4x16 LCD Help

    If you need to format numbers as string check the objects in the propeller tool and in the obex.
    "numbers" and "simple numbers" are a good solution. Simple numbers is less powerful but easier to use, and sometimes even better.
    This way you have an already formatted string available.
    if num is you simple numbers object,

    lcd.str(num.dec(1234))

    will do all the job for you. If you need more complex formatting decf and decx are available.
    Massimo

  16. #16

    Default Re: Parallax 4x16 LCD Help

    Perhaps i did not know what you were trying to accomplish and i only succeeded in making you more confused?
    I got the best hair around...Guaranteed!

  17. #17

    Default Re: Parallax 4x16 LCD Help

    no you helped alot by just replying. when i send numericalvalues over i know how to do it from your exmpale.

    Thanks
    Opportunity is missed by most people because it is dressed in overalls and looks like work.
    Thomas A. Edison

+ Reply to Thread

Similar Threads

  1. Replies: 28
    Last Post: 01-09-2012, 05:15 PM
  2. Replies: 7
    Last Post: 07-26-2010, 10:15 PM
  3. Replies: 2
    Last Post: 06-23-2009, 10:38 PM
  4. Replies: 3
    Last Post: 06-02-2009, 03:56 AM
  5. Replies: 1
    Last Post: 02-23-2007, 04:42 AM

Bookmarks

Posting Permissions

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