PDA

View Full Version : LCD Serout



RFEFX
- 30th November 2006, 17:16
Hello all,

I am trying to test my LCD. I am using Demo Version of PBP and it will not allow me to use Include Files.

If someone can compile the program below so that i may test my LCD i would appreciate it...

Once i test my board Fully and know the PBP works i will purchase...

also, if someone could even let me know if the program below will even work I would appreciate that too. I am using a Parallax 4x20 LCD @ 9600 Baud. I am using a PIC16F876A device.

Thanks,
Gary D.



INCLUDE "modedefs.bas"

SEROUT PORTA.5,N9600,["Hello World"]

keithdoxey
- 30th November 2006, 17:28
If you look in the Modedefs.bas file or the "Serout" section of the PBP manual you will see that N9600 is defined as

N9600 = 6 ' Driven Inverted

Do either of the following

N9600 CON 6 ' Driven Inverted to declare the constant

or

SEROUT PORTA.5,6,["Hello World"]

Both should compile as you arent using any include files.

RFEFX
- 30th November 2006, 18:40
Ok,

Awesome...

i have some activity but i think that the LCD is not getting enough Power.

Thanks a lot for your help !!

Gary D.

keithdoxey
- 30th November 2006, 19:12
i have some activity but i think that the LCD is not getting enough Power.


???

If it wasnt getting enough power it wouldnt work.

Assuming it is displaying the characters you sent then it probably just needs the contrast adjusting.

RFEFX
- 2nd December 2006, 19:17
Ok.... I have been tying to program this LCD for the last couple days..

Im using the PIC16F876A on PORTA.5

The LCD Specs are Here (http://www.parallax.com/dl/docs/prod/audiovis/SerialLCD-v2.0.pdf)

when i send

SEROUT PORTA.5,6,["Hello"]

or when i send

SEROUT2 PORTA.5,84,["hello"]


I get nothing but the Cursor moves around a lot.

Has anyone got code for the Parallax LCD 4x20 Module.

mister_e
- 2nd December 2006, 19:22
you have to disable the analog A/Ds

ADCON1=7

And probably analog comparator
CMCON=7

RFEFX
- 2nd December 2006, 20:01
Nope... Still nothing....

mister_e
- 2nd December 2006, 21:21
Is the Test mode work?

If so, set it to 2400 Bauds,, reset the LCD module and try...


ADCON1=7
CMCON=7
HIGH PORTA.5
PAUSE 500

SEROUT PORTA.5,4,["Hello"]
Z: goto Z


AND this one

ADCON1=7
CMCON=7

DEFINE DEBUG_REG PORTA
DEFINE DEBUG_BIT 5
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 0

HIGH PORTA.5
PAUSE 500

debug "Hello"
Z: goto Z
If i refer to their datasheet and the code example, it must be driven TRUE.

Wich osc speed are your using?

RFEFX
- 3rd December 2006, 20:17
LCD start up test works...

I am running a 20Mhz Crystal Oscillator in HS mode...

LCD is receiving data just not what i send it... Just a bunch of characters.



Regards,
Gary D.

RFEFX
- 5th December 2006, 06:49
since I was using the PIC16F876A in HS mode with a 20Mhz Clock... I failed to define the OSC....

ADCON1=7
CMCON=7
DEFINE OSC 20

and there you have IT... Serial LCD works like a charm...

Thanks to all that helped.