PDA

View Full Version : serout lcd



chip15
- 6th January 2007, 13:56
Hi all,
this code not work:


DEFINE OSC 20
INCLUDE "modedefs.bas"
PAUSE 1000
start:
SEROUT portb.1, 2, [254,1]
PAUSE 40
SEROUT portb.1, 2, ["Hello World"]
PAUSE 400
GOTO start
END

How to?

I have a LCD devantec 03 serial , 9600 baud
pic 16f84a 20i/p
crystal 20 Mhz

THX
chip

keithdoxey
- 6th January 2007, 14:46
Are you sending RS232 at the correct polarity ?

you are using Mode 2 aka T9600 True polarity @ 9600

try using N9600 (or mode 6) Inverted Polarity @ 9600

Presumably the onboard processor on the LCD display takes care of initialisation. does the display accept all normal HD44780 commands or does it have a custom set of commands for serial control of display parameters.

Can you drive the display from a PC using Hyperterminal or similar.

If you connect your PIC to a PC, can you see anything in Hyperterminal ?

Too many things could cause your problem and you havent provieded much info. Can you use a slower baud rate to start with eg 1200

chip15
- 6th January 2007, 16:16
0 null (ignored) Ignored as a no operation

1 Cursor Home Sets the cursor to the home position (top left)

2 Set cursor (1-80) Cursor to a position specified by the next byte, where 1 is the top left and 80 is the bottom right

3 set cursor (line, column) Sets cursor using two bytes, where first byte is the line and the second byte is the column

4 Hide cursor stops the position cursor from appearing on the display

5 Show underline cursor Changes the cursor to the underline type

6 Show blinking cursor Changes the cursor to the blinking type

8 Backspace deletes the preceding character from the current position on the display

9 Horizontal tab (by tab set) Moves the current position across by the tab space set by command 18 (default tab space 4)

10 Smart line feed Moves the cursor down one line to the position beneath in the same column

11 Vertical tab Moves the cursor up one line to the position above in the same column

12 Clear screen Clears the screen and sets cursor to the home position

13 Carriage Return Moves the cursor to the start of the next line

17 Clear Column Clears the contents of the current column and moves cursor right by one column

18 Tab set Sets the required tab size, the following byte can be a size of between 1 and 10

19 Backlight on Turns the backlight of the LCD03 on

20 Backlight off (default) Turns the backlight of the LCD03 off

27 Custom char generator allows 8 custom chars to be built. See custom char generator below

32-255 ASCII chars Writes ASCII chars straight to the display
-------------------------

to use DEBUG?
THX
chip

Sphere
- 6th January 2007, 23:49
Try this.

DEFINE OSC 20
INCLUDE "modedefs.bas"
PAUSE 1000
start:
SEROUT portb.1,2,[1]
PAUSE 40
SEROUT portb.1,2,[72,101,108,108,111,8,87,111,114,108,100]
PAUSE 400
GOTO start
END

Assuming where talking about the same display, the above in theory should work. Make shure the jumper is attached on the lcd.

Sphere...

owali
- 29th July 2007, 19:30
I am having the same problem as the original poster.

I am using a PIC16F84A with the RS-232 LCD display. I am using a 20MHz ceramic resonator as well. I can't get this simple program to work. I don't know what is wrong. Please help me figure this out...

@ DEVICE HS_OSC
DEFINE OSC 20
INCLUDE "modedefs.bas"
PAUSE 1000
Start:
Serout portb.1, 2, [254,1]
PAUSE 40
Serout portb.1, 2, ["Hello World"]
Pause 400
Goto Start
End

Archangel
- 29th July 2007, 20:10
Hello,
I see no mention of config fuse settiings: <br>www.picbasic.co.uk/forum/showthread.php?t=543&highlight=configuration+fuse
<br> Ok, some mention :)
If that display is true re232 - methinks you will have to use max232 in between. Most serial LCD
units are not true RS232 and will work with serout. Search my threads to find code for a serial backpack
that works really well without using "proprietary commands" It works with Scott Edwards' / Darrel's Bignums code as
well.