PDA

View Full Version : need serial 20x4 lcd code example



saulius659
- 6th October 2013, 15:34
i use pic16f628a or pic16f877a with serial lcd 16x2 or 20x4 (picaxe oled).

serout PortA.0,0,["Hello"]

It works OK with 16x2 serial lcd.
Nothing with serial 20x4.... I see hieroglyphs...
Also the same with sumalation in ISIS profesional....- 16x2 OK - "Hello", 20x4 - x v f g 5 h :)))
Do i need to make any different settings for serial lcd 20x4 ???

Thank you for any example how to start serial 20x4.

Saulius

AvionicsMaster1
- 6th October 2013, 17:16
I would be certain there are differences in code. Why not post yours so we can see what needs to be changed?

OBTW nothing is not same as hieroglyphs.

saulius659
- 7th October 2013, 13:13
Here is my code:
main:
pause 1000 ' wait for the LCD to startup
serout PortA.0,0,[$FE,$01] ' clear the screen
serout PortA.0,0,["Hello world !"] ' send string “Wherever you go”
serout PortA.0,0,[$FE,$C0] ' move the cursor to the 2nd line
serout PortA.0,0,[" Here we are "] ' send string “ there you are ”
pause 1000 ' pause for a second
goto main ' loop

Picture what i see is bellow.

7099

AvionicsMaster1
- 7th October 2013, 16:49
I don't see your configs or defines. That's usually where the issue lies.

This linkhttp://www.picaxe.com/docs/axe134.pdf has a test program. Did that work?

rsocor01
- 8th October 2013, 06:48
Saulius,

That has been done before by Darrel. Check this link

http://www.picbasic.co.uk/forum/showthread.php?t=626&p=2388#post2388

saulius659
- 8th October 2013, 10:58
It works fine with picaxe 08M2 and 20X2 i use. Also ok in parallel mode with pic. Only a problem conecting 20x4 to pic16f628a or 877a in serial.
For 16x2 i do not use any config or define settings and it works ok. Maybe you know what settings shoud i try??

AvionicsMaster1
- 9th October 2013, 01:34
Have you tried

main:
pause 1000 ' wait for the LCD to startup
serout PortA.0,4,[$FE,$01] ' clear the screen
serout PortA.0,4,["Hello world !"] ' send string “Wherever you go”
serout PortA.0,4,[$FE,$C0] ' move the cursor to the 2nd line
serout PortA.0,4,[" Here we are "] ' send string “ there you are ”
pause 1000 ' pause for a second
goto main ' loop

AvionicsMaster1
- 10th October 2013, 17:10
Just curious if that actually worked?

saulius659
- 17th October 2013, 11:43
Hello, works with this. Instead of communication speed "4" i used "2" - and ok, works.
Interesting, but it works only in simulation software i use.
I programed pic16f628a and pic16f877a with the same sample - still nothing.
Maybe i use wrong settings for programing pic (watchdog and others) or picaxe oled display inside has something protected....
A few days ago i ordered serial display from ebay, just to be sure, what is wrong.

main:
pause 1000 ' wait for the LCD to startup
serout PortA.0,2,[$FE,$01] ' clear the screen
serout PortA.0,2,["Hello world !"] ' send string
serout PortA.0,2,[$FE,$C0] ' move the cursor to the 2nd line
serout PortA.0,2,[" Here we are "] ' send string
pause 1000 ' pause for a second
goto main ' loop

AvionicsMaster1
- 18th October 2013, 00:16
Well, what is nothing. Nothing is not hieroglyphs.

You do realize the 16f628 and the 16f877a have different footprints? Port a.0 on the 16f877a is pin 2 and on the 16f628 it's pin 17. They both are both analog so must be set to digital. I don't think serout setting it to output sets pin as digital.

It would be best if you posted entire code and not snippet.