Shop OBEX P1 Docs P2 Docs Learn Events
Need Help with LCD screeen. — Parallax Forums

Need Help with LCD screeen.

jdpetersdocjdpetersdoc Posts: 26
edited 2008-12-23 03:11 in Learn with BlocklyProp
btn_spacer.gif· I have the LCD Terminal AppMod, and I'm not sure how to program it. Im using the Basic Stamp 2, I downloaded the smiple code for it off parallax's website and I was really confussed in how to program it. If anyone has any suggestions I would appreciate it!



·Joshua Peters

·'If it doesnt do something automatic, then its not a Stamp.

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-20 12:50
    The demo code is somewhat overly complicated, because it's meant to include the code for both the BS2 series and the BS2p series (which has additional commands that simplify control of parallel LCDs). All of that #IF _LcdReady #THEN stuff is compiler directives meant to choose code for one or the other type of Stamp, and is not relevant to what you need. For example, look at this subroutine:

    LCD_Command: ' write command to LCD
    #IF _LcdReady #THEN
    LCDCMD E, char
    RETURN
    #ELSE
    LOW RS
    GOTO LCD_Write_Char
    #ENDIF
    
    LCD_Write_Char: ' write character to LCD
    #IF _LcdReady #THEN
    LCDOUT E, 0, [noparse][[/noparse]char]
    #ELSE
    LcdBusOut = char.HIGHNIB ' output high nibble
    PULSOUT E, 3 ' strobe the Enable line
    LcdBusOut = char.LOWNIB ' output low nibble
    PULSOUT E, 3
    HIGH RS ' return to character mode
    #ENDIF
    RETURN
    



    Since you have a BS2, what you need is

    LCD_Command: ' write command to LCD
    LOW RS
    LcdBusOut = char.HIGHNIB ' output high nibble
    PULSOUT E, 3 ' strobe the Enable line
    LcdBusOut = char.LOWNIB ' output low nibble
    PULSOUT E, 3
    HIGH RS ' return to character mode
    RETURN
    
    



    Everything else in there is simply there to show how a BS2p or BS2pe would handle things. On those processors, the subroutine would look like this

    LCD_Command: ' write command to LCD
    LCDCMD E, char
    RETURN
    



    Try going through the code and removing everything that is for the "LcdReady" processors, and see if what's left makes more sense to you. I had to look at it all quite a few times before I understood it.
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-20 18:54
    Here (attached) are versions of the LCDAppmod demo program with most of the conditional stuff removed (I left in the part that tells you which BS2 chip you're using). These should make it much more clear how to use the LCD Appmod, and also what the advantages of using a 2p, 2px, or 2pe module are with a parallel LCD.
  • jdpetersdocjdpetersdoc Posts: 26
    edited 2008-12-22 23:11
    ·sylvie369,

    ·· It makes sense now, theres onl;y one problem.........I cant find my LCD screen now cry.gif .



    I apperciate you writing that code.....Ill try and fing my LCD screen, it couldnt have gone to far =).
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-23 00:55
    It's behind that box over in the corner.
  • jdpetersdocjdpetersdoc Posts: 26
    edited 2008-12-23 03:11
    hahaha......yeah.··· Ill find dont worry. But thanks again for the help !!!smile.gif
Sign In or Register to comment.