Hello lazybee,
I can't be sure of the constraints on your application, I am guessing
DOS or an embedded system instead of Linux or Windows. If not, you
should ask for clarification if the following links don't answer your
question. In particular, your BIOS or operating system drivers may
have settings for both ECP and DMA settings that may be simpler than
the solutions I refer to below. Be sure to mention the system and OS
in a request for clarification if needed.
Perhaps the best summary to the "Standard Parallel Port" is at...
http://www.beyondlogic.org/spp/parallel.htm
which starts with some general information but includes the port
addresses, bit assignments (including the DMA bit), and has sample C
code that accesses the various port addresses.
Additional information on ECP settings is at...
http://www.beyondlogic.org/ecp/ecp.htm
which includes the settings for the ECP configuration words (e.g., IRQ
setting, DMA channels used).
A site that has several good links is "The PC's Parallel Port" at...
http://www.lvr.com/parport.htm
I checked a number of references it provided and they appear to have
good information.
If you need specific information on how to program the DMA, I will
definitely need more information. You generally set the base address,
length, and then enable the DMA - but there are specifics for each
kind of DMA. You may also need to run benchmarks. In a real time
system I am familiar with, DMA is faster than PIO for data transfers
of 12 bytes or more, and a busy wait for DMA complete is faster than
the task switching overhead.
If you want to search more on your own, search phrases that can help
find additional information include...
"source code" "parallel port settings"
"source code" +DMA
Include phrases such as the operating system name and part name /
number for the DMA to restrict answers to your specific situation.
--Maniac |
Clarification of Answer by
maniac-ga
on
04 Sep 2002 18:38 PDT
Hello lazybee,
To answer your clarification request, let me break it into parts with
reference to the links provided and providing an additional reference.
This appears to be best set by the BIOS, but I'm providing a couple
alternatives that should work with your own code.
The link
http://www.beyondlogic.org/spp/parallel.htm
in the section titled "Parallel Port Modes in BIOS" indicates that you
normally enable ECP in the BIOS. It also indicates that the software
can change these settings by writing to configuration registers at
0x2FA, 0x3F0, 0x3F1, etc. but that this is not portable since there is
no standard for these registers. A quick look at a few other sites
appears to confirm this assessment.
At this point, you probably need specific vendor documentation to
determine which address to change and the bits to be set. A search
using google with phrases such as
+ecp +bios +3f0 +"configuration register"
turns up a set of PDF files that may help.
Another alternative is to download a recent Linux kernel and look in
the parport code for chip detection and various settings. For an idea
of the code and how it works, look at
http://home.t-online.de/home/gunther.mayer/gmpatch-2399p6-superio_4a
which is a patch for a kernel version just prior to the 2.4 release.
There are also BIOS replacements such as...
Open BIOS
http://www.freiburg.linux.de/OpenBIOS/
Linux BIOS
http://www.linuxbios.org/
which may have relevant code as well.
As another option, if you have a restricted set of equipment to work
with, what you could do is...
- clear the ECP setting in the BIOS, and read the range of addresses
for the configuration registers to determine the "not set" condition.
- set the ECP setting in the BIOS, and read the same configuration
registers to determine the "set" condition.
That would give you the settings for the particular motherboard and
chip combinations that your equipment uses. If the BIOS gets out of
configuration, you could then have the software "make it right" by
reading the existing value, making the changes noted above, and then
rewriting those values.
I hope one of these techniques provides the data you need (specific
address and value settings). If not, let me know and I will dig some
more on this question.
--Maniac
|