Shop OBEX P1 Docs P2 Docs Learn Events
serial lcd problems...... want command like bs2 debug — Parallax Forums

serial lcd problems...... want command like bs2 debug

SawmillerSawmiller Posts: 276
edited 2005-08-15 13:39 in General Discussion
hi y'all

i have been trying to hook up a scott edwards serial lcd·( the·ILM-216 ) to my sx28 using the tech board
i can get the screen to flash using this snippit of code ( in the template of course )
main :
··· pauseus 1000
··· serout RA.1,N2400,14 ' turn on backlight
···· pauseus 1000
··· serout RA.1,N2400,15· ' turn off backlight
··· goto main

now the problem is· its not consistent !!
sometimes the screen flashes twice then stops, sometimes· comes on and just stays on..

i know it should be consistant.. also i cant seem to write to the screen any letters and· such and have them be the same all the time...
i think it has to do with the serout command, because the same lcd , hooked up to a bs2 works fine... or could it be that the sx just talks too fast ???
hop.gif anyways the reason i started this thread is a sugestion for the next rev of SXB i would like a command that would· open up a screen on the pc and i could output regular text to it to test my apps.

i know we have the debugger, and i can look at one char a time if i set up a watch... (that is if my sx-key would stay found on my computer,) but one char a time isnt the same as seeing the whole string outputed....

ps tried using a usb-> serial port for the sx-key problem ,no go ( see earlier thread on problem, http://forums.parallax.com/showthread.php?p=545559 ) the 1000 uF cap helps in programming but cant use debugger that way so i end up running code thru the sx-sim· ( thanks gunther daubach ) to be able to look at it

am going to go get a another computer.... just to play with this hobby of mine... any suggestions ?

dan ( dazed and confused )


Post Edited (Sawmiller) : 8/12/2005 1:51:40 PM GMT

Comments

  • nick bernardnick bernard Posts: 329
    edited 2005-08-12 14:36
    did you try other baud rates to see if you get the same results, try N9600?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If I lived back in the wild west days, instead of carrying a six-gun in my holster, I'd carry a soldering iron. That way, if some smart-aleck cowboy said something like "Hey, look. He's carrying a soldering iron!" and started laughing, and everybody else started laughing, I could just say, "That's right, it's a soldering iron. The soldering iron of justice." Then everybody would get real quiet and ashamed, because they had made fun of the soldering iron of justice, and I could probably hit them up for a free drink. - Jack Handy
  • BeanBean Posts: 8,129
    edited 2005-08-12 14:43
    Make sure you have the FREQ specified correctly or your baud rate will not generated properly.
    Can you attach the complete program ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-12 16:19
    Sorry, there will be no Debug window (BASIC Stamp style) in the SX-Key IDE; you'll need to connect a serial port and send data through that connection (using SEROUT).· The BASIC Stamp has that kind of feature because it uses a generic serial connection for programming -- there is no way to send serial data back up the SX-Key due to its connections to the SX (not to any IO pins).
    Sawmiller said...
    hi y'all

    <snip>


    hop.gif anyways the reason i started this thread is a sugestion for the next rev of SXB i would like a command that would· open up a screen on the pc and i could output regular text to it to test my apps.

    <snip>

    dan ( dazed and confused )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 8/12/2005 4:42:09 PM GMT
  • SawmillerSawmiller Posts: 276
    edited 2005-08-12 18:28
    bummer on no easy to use , text output.....



    dont understand the freq command that you asked about... its set to the default template



    as for the baud rate , the lcd's default is 2400, would have to jumper across the lcd to get 9600
  • BeanBean Posts: 8,129
    edited 2005-08-12 18:41
    Are you are using the internal 4MHz clock ? If so it is NOT accurate enough for serial communications.
    Use a resonator and change the DEVICE line as needed.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • SawmillerSawmiller Posts: 276
    edited 2005-08-12 19:03
    ahhh i seee , ok will try that, thanks bean
  • nick bernardnick bernard Posts: 329
    edited 2005-08-12 19:56
    saw,
    the jumper is easy to install, on my ilm-216 test rig i soldered a small jumper from pin 6 to pin 8 on the lcd. a small price to pay for a faster refresh rate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If I lived back in the wild west days, instead of carrying a six-gun in my holster, I'd carry a soldering iron. That way, if some smart-aleck cowboy said something like "Hey, look. He's carrying a soldering iron!" and started laughing, and everybody else started laughing, I could just say, "That's right, it's a soldering iron. The soldering iron of justice." Then everybody would get real quiet and ashamed, because they had made fun of the soldering iron of justice, and I could probably hit them up for a free drink. - Jack Handy
  • SawmillerSawmiller Posts: 276
    edited 2005-08-12 20:21
    thanks bean, put a 50 mhz resonator there and its reliable... can turn on and off backlight, do serout individual chars... great

    still havent got that tx_byte routine to work, gives me garbage on screen... but at least what i get is what i tell it to tongue.gif

    will go and solder that jumper in,faster is better , no ?

    thanks for the advice folks...
    ·
  • nick bernardnick bernard Posts: 329
    edited 2005-08-12 22:01
    here'e some code that i'm working with right now. it reads proper through a max232 to hyperterminal.
    try it. its modular!

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SetBuffer:
    ' Sets the buffer for transmition
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    PUT buffer(0), "H", "E", "L", "L", "O"
    RETURN


    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TXBYTE:
    ' transmits a single byte
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ax = __PARAM1 ' char to send
    SEROUT txPin, Baud, ax ' send the character
    RETURN


    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Broadcast:
    ' transmits entire buffer
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    FOR idx = 0 TO 4
    TXBYTE buffer(idx) ' transfer buffer
    NEXT
    dirPIN = 0
    RETURN

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If I lived back in the wild west days, instead of carrying a six-gun in my holster, I'd carry a soldering iron. That way, if some smart-aleck cowboy said something like "Hey, look. He's carrying a soldering iron!" and started laughing, and everybody else started laughing, I could just say, "That's right, it's a soldering iron. The soldering iron of justice." Then everybody would get real quiet and ashamed, because they had made fun of the soldering iron of justice, and I could probably hit them up for a free drink. - Jack Handy
  • SawmillerSawmiller Posts: 276
    edited 2005-08-13 10:42
    thnks nick , that snippet o code works good.. guess i will put my string variables in that way. the DATA/READ commands dont seem to work right for me..



    progress yeah.gif
  • BeanBean Posts: 8,129
    edited 2005-08-13 12:22
    READ is definately the way to send data to the LCD. With the latest version of SX/B (1.41) you can do stuff like:

    TXSTR "Hello there!"

    Or

    Message:
    DATA "Hello There!",0

    TXSTR Message

    using code such as:
    '
    TXSTR SUB 2 ' String parameter counts as 2

    TXSTR:
    · TempOffset = __PARAM1
    · TempBase = __PARAM2
    · DO
    ··· READ TempBase+TempOffset, TempChar
    ··· IF TempChar = 0 THEN EXIT
    ··· TXBYTE TempChar
    ··· INC TempOffset
    ··· TempBase = TempBase + Z ' Adjust base if offset overflows
    · LOOP
    · RETURN
    '

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • nick bernardnick bernard Posts: 329
    edited 2005-08-15 13:39
    yeah i definately agree with bean. if you're storing pages of text the most efficient solution is definately read, that snippetts from a tranceiver network where the buffer is repetitive.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If I lived back in the wild west days, instead of carrying a six-gun in my holster, I'd carry a soldering iron. That way, if some smart-aleck cowboy said something like "Hey, look. He's carrying a soldering iron!" and started laughing, and everybody else started laughing, I could just say, "That's right, it's a soldering iron. The soldering iron of justice." Then everybody would get real quiet and ashamed, because they had made fun of the soldering iron of justice, and I could probably hit them up for a free drink. - Jack Handy
Sign In or Register to comment.