Hi out there

The reason for me to start learning assembler this summer was to develope an application to control my autopilote. First step was to receive input data (ascii) from a Garmin GPS via the commport. That's easy and done. Next step is to parse the GPS sentences to get the adequate data information. That's easy too and done. The data is then calculated in order to send signals to the autopilote.

That's the difficult part, not the calculation but the communication to the pilote. The signals should be H or L to the data pins of the LPT-port. Each pin is connected to a relay or cmos electronics. One relay for steering starboard, one for aport, and one for standby/action.

Assembler opcodes IN and OUT communicate whit LPT-port but windows don't allow direct access. A driver that follows some special protocols and makes some special calls is needed. There are several drivers on the net. I don't like blackboxes so I would like to write my own device driver, if I can.

Can any of you out there, give me some hints how to write such dewice driver or perhaps som code example. I would be greatful.

Thanks
minor28
Posted on 2002-10-25 06:24:53 by minor28
CreateFile or WinIO maybe ?
Posted on 2002-10-25 06:31:28 by JCP
minor28:

If you want to learn how to write KMDs, you will find a great help in:


J. Finnegan: Pop Open a Privileged Set of APIs with Windows NT Kernel Mode
Drivers


This info is valid for WinNT, 2k and XP. For win 9x, you can read the Iczelion
VxDs tutorials. You will need the Windows DDK.

Anyway, if you only need to comunicate with the LP port, you can use the
WinIo library.
Posted on 2002-10-25 11:29:03 by n u M I T_o r
Posted on 2002-10-25 11:31:53 by JCP
Now here is a person who truely trusts his coding :eek:

I'm not sure if your flying or boating, but you might want to write some buffering routines as well, to keep the outputs from 'ringing' between modes of operation. Kinda like software level 'Schmitt Triggers'.... Definitely if your flying (i would imagin).

Best of luck..
:alright:
NaN
Posted on 2002-10-29 01:12:13 by NaN
Hi NaN,
Of cource I trust my code, specially when it boating.

Hi Readiosys
CreateFile only works with the serial port not the parallel. I have tryed The WinIO package but I couldn't get it to work. However I found another package DLPortIO. Now I can set my data pins D0 to D7 HI or LO.

Hi n u M I T_o r,
I will try to write my own package later.

For those who are intrested I attach my code. The DLPortIO package can be downloaded here. I you want to see the result just connect 8 leds to the D0 to D7 pins of the parallel port like this.

D0=pin2-------|>|----------pin 25 = ground
.
.
D7=pin9-------|>|----------pin 25 = ground

I will be simplified if you use a test board to do the connections on.

Regards
Posted on 2002-12-25 15:44:09 by minor28