Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Serial/Parallel port under Windows

Status
Not open for further replies.

patroclus

New Member
Why many home-made programmers use a software under DOS, and it does not work under windows??
As I know, Windows takes some control over ports so certain low-level instruccions just don't work. But.. isn't it possible to control the paralel port under Windows if you write a program for it, for example in C++ or Delphi??
 
Yes windows kinda takes control over the ports, but this is done by the CPU's permission map.

You need to modify this map, this requires a kernel mode driver (as you need to use an un-documented kernal mode API call to achive this).

This sounds scary, but is actually very simple, there is a good example in DDJ, and www.beyoundlogic.org has a nice example (Called PortTalk).

These are written in C++ becuase Delphi is terd.
 
You can use DLL libraries to access parallel port in windows
do a search for DLPORTIO

Serial port communications are included in the windows api, no drivers needed.
 
patroclus said:
Why many home-made programmers use a software under DOS, and it does not work under windows??
As I know, Windows takes some control over ports so certain low-level instruccions just don't work. But.. isn't it possible to control the paralel port under Windows if you write a program for it, for example in C++ or Delphi??

You can directly access the ports under 16 bit Windows, or the non-NT 32 bit Windows (95, 98, Millenium) - but all the NT based Windows don't allow it. Delphi versions later than 1.0 (the only 16 bit version) don't even include the Port[] instruction - although you can do it with an assembler routine (but only for 95,98 and Millenium).

As mentioned, you need a hardware driver dll to do it under NT, the dlportio mentioned is the one I use in WinPicProg - which (as far as I know) was the first Windows PIC programmer.
 
KS

there is a good book that i bought..

that's called Port unther windows

it came whit a cd-rom and defenitly you need the files on that cd-rom...

it is full of examples whit Delphi and Visual basic.

it comes whit a dll called port.dll

and offcourse a port.bas whit the functions declared (in conjucting whit port.dll)

soow offourse there is a way to do this.

But remember one thing..!!

Win2k and XP and NT4 don't have the port performance as high as win9x..and dos..!!!

in fact my 2,4Ghz p4can't loop as fast as a P166Mhz whit win98..!!

Do

state pin1

num=num+1

LOOP time=off

TKS

My P4 240000 times per second

and the P166 over million

later when you put some if then statemens offcourse the p4 remains power fulle and de p166 drops dramatacilly...
 
I built my own programmer for PIC's , AVR's, 89cXX51 flash and 2864 and i made a program using visual basic.net and the interface is the RS232 COMM port.
Its not that hard to do it but it takes time and more than basic programming skilles...
 
just to clear it up, its not a dll you need its a kernel mode driver (.sys) file, as such administrator priviledges are needed.

dlportio is ok, but myself, its no effort to make your own sys file, and its often best to understand the tools your using.

see www.beyoundlogic.com port talk.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top