“Warren MacEvoy” <firstname.lastname@example.org> wrote:
I would like to use the parallel port in QNX to drive master-mode SPI
devices. I got it to work, but it’s too slow. It seems to boil down to the
time it takes to do the assembly in and out instructions,
which (on a PIII
600 I tried it on), was about 50 times slower than just writing to > memory.
It SHOULD be even more… u may be using a faster RAM than mine
Even a PIV 1GHz wont help… PC-AT hardware spec are like that (remember the
“jmp $+2” sequences… littered up in the communications and hardware driver
software used to insert small delays) actually the PC-AT PCI timing is a bit
off, it requires timing synchonization to work properly which is done by the
(qnx)library… (things are a “bit” better in linux device drivers where you
have both functions… with-in-built-delay and non-inbuilt-ones)
If by any chance you are using ECP parallel port (i’m sure u have one, as no
PIII motherboard comes without a EPP+ECP parallel port, though u may have to
enable the ECP mode and select the DMA channel through BIOS), use DMA to
transfer data… it will be HELL FASTER than manually doing it. BTW i dont
have a hands on experience with ECP/EPP parallel ports, if you have follow it
on to me too, please
I checked in Windows, and the order-of-magnitude difference was >there also.
From reading intel architecture docs, I understand it’s possible to use
memory-mapped I/O instead of the in and out instructions, provided that
caching is disabled for the mapped pages.
Nope… no way now, I think its done only on a sun sparc, (it is the ONLY way
on that hardware)
Because the in and out
instructions wait for an acknowledgement before executing the next
No… they wait for the timing signal… (as per best of my belief… correct
me if i’m wrong)
(and the memory mapped IO does not),
If it wont (if at all, in theory), it will mess up your data
I am hoping this route will
solve my current problem.
I think the ECP way can… also try EPP though i dont know how much better is
it than SPP
However, I don’t know how to do this in neutrino (or any other OS for that
matter). I tried using mmap_device_io(), but the call was not consistent
with the documentation (which hinted they wouldn’t do anything useful on
intel hardware anyway).
on intel directly do out8(0x378, mydata), no mmap_device_io is explicitely
required… it is there only for cross platform consistency
Hope that’s helpful, do let me know of developments
A ship ought not to be held by one anchor, nor life by a single hope.
Indian Institute of Technology Bombay
Sent via Deja.com