PDA

View Full Version : Delphi driver


BasieP
2001/11/23, 11:27 PM
does anyone of u has ever made a driver for delphi?
i want to add a serial support for my LCD program (LCD Smartie, check homepage) and i have programmed all the stuff in delphi 5

now i need a driver, and i thought maybee u allready have made one

can someone help?

TIA
BasieP

wax
2001/12/07, 01:19 AM
Goto www.torry.ru and download a component that interfaces with a serial port, thats all you need.

BasieP
2001/12/08, 10:01 AM
i allready have such a component, but how are the initstrings and writedatastrings for an CF LCD?

CrystalControl Admin
2001/12/09, 05:56 AM
What do you mean by "how are the" ??

If you mean commands to clear, move the cursor, etc on the LCD display, go download either the 632 or 634 full datasheet. It lists all the commands and what they do.

BasieP
2001/12/09, 01:59 PM
what's the differents between those two?

CrystalControl Admin
2001/12/09, 08:17 PM
The LCD size...

http://www.crystalfontz.com/products/index-ser.html

BasieP
2001/12/16, 03:31 AM
I now have made a driver, but it doens't work at all...

i do this @ startup:
VaComm1.Baudrate:=br19200;
VaComm1.PortNum:=2 <-- poortnumber
VaComm1.Open; <-- open the comport

then i do this:
VaComm1.WriteChar(chr(17)); <-- write char '17' to LCD
VaComm1.WriteChar(chr(0)); < write char '0' to set pos 0
VaComm1.WriteChar(chr(0)); < write char '0' to set line 0
VaComm1.WriteText('w00000t'); < write a string to the LCD

but nothing happends
is there something i have to do first?

MWP
2001/12/16, 07:49 AM
Download the datasheet for your LCD.

Itll have a flowchart of the things you have to do to get it setup.

BasieP
2001/12/16, 01:25 PM
i allready have, but i realy can't find a flow chart.. and i have the complete version.

But if you know, can u tell me then?

MWP
2001/12/16, 09:08 PM
Ooops... sorry i was thinking of other datasheets :(

Yeh, what youve done should work.
But there are some other things you can try like setting brightness&contrast, changing cursor type, make sure the lcd is turned on (Restore display).
You may also want to try usin the reset command first.

BasieP
2001/12/16, 10:39 PM
Thanx, i will give it a try

BasieP
2002/01/01, 06:53 AM
Originally posted by BasieP
Thanx, i will give it a try

well, i did, but nothing seems to work.

Can someone post a VB, or C++ code? of a working program?
then i can see for myself.
I think i am forgetting something stupid, but i will never know, because i don't have a good example

i only need to know the data that is send to the LCD, and so the language doesn't matter

MWP
2002/01/02, 04:32 AM
Originally posted by BasieP

Can someone post a VB, or C++ code? of a working program?
then i can see for myself.


http://www.crystalfontz.com/products/wintest/index.html

BasieP
2002/01/03, 12:10 AM
thanx, i could have thought about it myself. |:(

BasieP
2002/01/03, 06:04 AM
:(
ik looked at that code for 20 times now, and i don't get what i am doing wrong...

can someone PLEASE paste here just that little bit of data they send to the LCD to get it to work?

i can't init the LCD

BasieP
2002/01/13, 03:36 AM
/me is wondering howmany ppl realy read this..

anywayz: Still nothing works!
i even tried change-ing the contrast and the backlight. |:(

but nothing seems to work.
I'll ask again:
what do you accualy have to send to a CF LCD to get a little text on it???

a lot of you allready made a driver, so you know..
please share it

Mp3Commander
2002/01/13, 02:59 PM
TRY THIS (http://www.mp3car.com/usersites/Mp3Commander/Downloads/LCDinterface.zip)

BasieP
2002/01/13, 11:19 PM
euh..
thanx..

you are aware of the fact that this is a Visual Basic driver?
i will try to look at it, but i don't even have Visual Basic.. :(

BasieP
2002/01/14, 08:26 AM
http://www.rendo.dekooi.nl/~fjbgp/Project1.zip

that's the one i made. The problem is that my test person says that it doesn't work.

He did said that with all my drivers.. :(
but i am beginning to be unsure, because i tried EVERYTHING!, and the result is always the same.

He says that other programs work perfect.

can some of you please take a look?
this is the most simple version there is.

Connects to a commport (just choose) @ 19200 and sets backlight to 100, and contrast to 60.
Then it writes a very short line

Mp3Commander
2002/01/14, 05:17 PM
it does not work, maybe if you post the code I can tell you what is the problem.

BasieP
2002/01/15, 01:20 AM
ok.
Here it is:

procedure TForm1.Button1Click(Sender: TObject);
begin

VaComm1.Baudrate:=br19200;
VaComm1.PortNum:=StrToInt(edit5.text); //<-- number of the port
VaComm1.Open;

VaComm1.writeChar(Chr(14)); //<--backlight
VaComm1.writeChar(Chr(100));

VaComm1.writeChar(Chr(15)); //<--contrast
VaComm1.writeChar(Chr(60));

VaComm1.WriteChar(chr(17)); //<--setpos (1,1)
VaComm1.WriteChar(chr(1));
VaComm1.WriteChar(chr(1));
VaComm1.WriteText(edit1.text);

VaComm1.WriteChar(chr(17)); //<--setpos (1,2)
VaComm1.WriteChar(chr(1));
VaComm1.WriteChar(chr(2));
VaComm1.WriteText(edit2.text);

VaComm1.WriteChar(chr(17)); //<--setpos (1,3)
VaComm1.WriteChar(chr(1));
VaComm1.WriteChar(chr(2));
VaComm1.WriteText(edit3.text);

VaComm1.WriteChar(chr(17)); //<--setpos (1,4)
VaComm1.WriteChar(chr(1));
VaComm1.WriteChar(chr(3));
VaComm1.WriteText(edit4.text);

Vacomm1.Close;
end;



you can see that VaComm1.... is the component i use to controll the serial port.
Note: It DOES work, i CAN control other non-CF LCD's with it, and also made a program to send data to other computers with that component

Mp3Commander
2002/01/15, 11:19 AM
maybe you have to keep the port open.

try to open the port when the form start. And close it when unload.

Mp3Commander
2002/01/15, 11:24 AM
Yep. that's the problem. the same happens in VB :)

BasieP
2002/01/15, 12:27 PM
http://www.rendo.dekooi.nl/~fjbgp/Project1.zip

there it is. Can someone test it?

TIA

Mp3Commander
2002/01/15, 01:27 PM
still the problem.
It doesn't even turn on the backlight in the LCD.

BasieP
2002/01/15, 01:38 PM
did you notice that there was a text file included. there you have to fill in the port!

if not.. then.. screw me :(

i tried realy everything.. ;(

Mp3Commander
2002/01/15, 01:47 PM
I think the problem is that you have to set RTS and DTR enable.

BasieP
2002/01/15, 02:18 PM
/me is looking into his pfd file....

If the display in your system is powered by the serial port's RTS and DTR lines, the
display can be rebooted by dropping those lines momentarily (say 500mS) and then
bringing them high again.


how do i do that?

Mp3Commander
2002/01/15, 05:24 PM
I dont know how to do it in delphi. Most be something like this:

VaComm1.RTS = true;
VaComm1.DTR = true;

BasieP
2002/01/15, 11:24 PM
aha!, is that some kind of handshaking lines?
anway: RTS and DTR are on now, can you test again?

www.rendo.dekooi.nl/~fjbgp/Project1.zip

Mp3Commander
2002/01/16, 07:56 PM
Bad news: Doesn't work.:(

keep trying, I'll test it for you :) .

BasieP
2002/01/16, 11:19 PM
ok.. what's next?

i allready made the RTS and DTR.
I read something about sending 2 esc (chr27) and 4 spaces (32)?
should i do that?

CF Tech
2002/01/17, 10:06 AM
BasieP:

To make sure your hardware all works, please run WinTest.

Once you have the PC set its RTS and DTR high, the display should come on. By default, it will show the splash screen (with the baud rate) for a few seconds, then go to a block cursor.

Then the display will show whatever comes across the serial port (at the correct baud rate:)).

As a test, just set HyperTerminal to open "direct" "COM1" "19200" and you should be able to type and arrow directly around the display.

I am sorry that you are having trouble getting your Delphi driver going. We do not have much experience outside of C and assembly here, but it does seem that you have received some useful input from the other forum members.

Mp3Commander
2002/01/17, 10:58 AM
try using LCDDriver (http://lcdriver.pointofnoreturn.org/).

BasieP
2002/01/17, 11:06 AM
well, first of all: i am a programmer, i allready have an LCD, but it's not a crystal fontz one.

that's why i can't test my programs and post them here, for you to test.

I was thinking about building support for your LCD's in my program .

on 01-17-2002 08:06 PM, crystalfontz
wrote the following:
Once you have the PC set its RTS and DTR high, the display should come on. By default, it will show the splash screen (with the baud rate) for a few seconds, then go to a block cursor.

i did that, but the LCD didn't even blink.. (see the reply from Mp3Commander.)
I have tested many ways now, but nothing seems to work.
I also have the bad feeling that you don't exactly know how to control your LCD's.
That's no offence, but I would love to know.
This means that or i have to get my own Crystal Fontz LCD (to test) or i need a little more support here.
I am almost done building version 5 of [url="www.rendo.dekooi.nl/~fjbgp/smartie"LCD Smartie ("www.rendo.dekooi.nl/~fjbgp/smartie"LCD Smartie[/url). This version has many things very much improved.

When i am done with the programming, and i still have troubles i will release it.... Without Crystal Fontz support...

Chrix
2002/01/17, 03:44 PM
Never mind about the crystal fonts support basie, your software kicks ass without it m8 :) sorry to all the people who have crystal fonts LCDs, but Matrix orbitals are better anyways.

Look at this prime example I found earlier...

http://users.ox.ac.uk/~some0814/morecols/lbluegr2.jpg

rrr, poor thing, was just lying about with nobody to love it :(

justnic
2002/01/17, 07:42 PM
I dont think that is true i have not once foud a lcd maker that offers different colers backlight and font colors so i think matrix optical is worse because they dont have that good of slection so i would forget -chrix-:p

BasieP
2002/01/17, 11:26 PM
Originally posted by justnic
I don't think that is true. I have not once found a lcd maker that offers different colers backlight and font colors. So I think matrix optical is worse, because they don't have that good of slection. So i would forget -chrix-:p

well, they did not forget anything, and indeed i get the feeling MO is indeed a little more customer-friendly
i am not talking about the LCD's, but just the support.

And Matrix-Orbital HAS a lot of different colors!

justnic
2002/01/18, 05:36 AM
Ya some wat but they only have one way to connect them!! serial I HATE SERIAL!!!! LOL

TheCheeseMan
2002/01/18, 09:59 AM
Originally posted by -chrix-

rrr, poor thing, was just lying about with nobody to love it :( [/B]

It was not! It has a perfectly good home thank you very much :p

r.