Shop OBEX P1 Docs P2 Docs Learn Events
Serial LCD problem — Parallax Forums

Serial LCD problem

c2h5ohc2h5oh Posts: 3
edited 2010-02-18 14:59 in Learn with BlocklyProp
Hello everybody,

I have a problem with communication with serial LCD (2x16 non-backlit) from Parallax. I tried to send serial data to this LCD many times, but without good results.
I don't use BS2 (I have two BS2 modules, but I think they are too expencive for beginners like me), I rather use PIC16f84a and PIC16F876a. I write program in MicroCode Studio and compile it with PicBasicPro.

My code for sending data to LCD looks:

serout portb.3, 19200, [noparse][[/noparse]"hello"]

Compiler writes, that code is all right and when I connect pin B3 to oscilloscope, there is a signal.

I tried to use all three bauds (2400, 9600, 19200), but still have no letters or display shows senseless symbols. Where could be a problem?

I usually use 4MHz crystal for timing - could be problem there?


Thanks very much for answer

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-02-17 19:22
    How are you setting the contrast? Sometimes it's set wrong, everything is working, but you STILL can't see the letters.

    Oh, wait, you DO see "senseless symbols", so you ARE getting communication.· So, are you properly selecting inverted vs. non-inverted mode?· Is that "19200" a correct value? (Because typically the "baud-rate selector" isn't a literal baud rate)
  • c2h5ohc2h5oh Posts: 3
    edited 2010-02-17 20:17
    Yes, contrast is right, because when I select test mode, demo text appears correctly.

    I always use same boudrate in program code and on LCD switch panel. I tried all three modes (2400, 9600 and 19200) with almost same results.

    How can I choose between inverted and non-inverted mode?

    What do you mean with "isn't a literal baud rate"? How can I found out, that for example baud-rate 9600 from code is similar (with adequate accuracy) to 9600 on LCD?

    Thank you for answer
  • c2h5ohc2h5oh Posts: 3
    edited 2010-02-18 14:59
    I solved problem. Datasheet for LCD is from parallax and code is written for BasicStamps.
    Well, in picbasic is necessary to select if I want baudrate n2400 or t2400 and at the top of programe write:

    INCLUDE "modedefs.bas"

    where are defined constants for symbols. For my LCD was necessary to select true values (noninverted).

    Thank you allanlane5 for help.
Sign In or Register to comment.