* Treating parallel port as serial device
@ 2001-08-28 20:09 Tony Hoyle
2001-08-28 20:15 ` Philip Blundell
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tony Hoyle @ 2001-08-28 20:09 UTC (permalink / raw)
To: linux-kernel
I'm looking to attach a serial device to my box that has only TTL level
I/O. Since I'm more of a software than a hardware person making a
circuit board up with a max232 in is a bit risky... I want to connect
the I/O to the parallel port.
What I need now is a driver that can read the input from a pin on the
parallel port and treat it as serial input. It sounds like the kind of
project that would have been done before, but I can't find anything that
even comes close. Userspace probably wouldn't cut it as I'm reading as
9600 baud and usleep doesn't have nearly enough resolution.
Tony
--
Microsoft - two out of three dead people who expressed a preference
said their coffins preferred it.
tmh@nothing-on.tv http://www.nothing-on.tv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Treating parallel port as serial device
2001-08-28 20:09 Treating parallel port as serial device Tony Hoyle
@ 2001-08-28 20:15 ` Philip Blundell
2001-08-28 20:38 ` Christopher Friesen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Philip Blundell @ 2001-08-28 20:15 UTC (permalink / raw)
To: Tony Hoyle; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 310 bytes --]
>even comes close. Userspace probably wouldn't cut it as I'm reading as
>9600 baud and usleep doesn't have nearly enough resolution.
9600 baud is only 1 bit every 100us or so. SCHED_FIFO and nanosleep should be
perfectly adequate for timing. You can use ppdev or direct port I/O to get at
the pins.
p.
[-- Attachment #2: Type: application/pgp-signature, Size: 237 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Treating parallel port as serial device
2001-08-28 20:09 Treating parallel port as serial device Tony Hoyle
2001-08-28 20:15 ` Philip Blundell
@ 2001-08-28 20:38 ` Christopher Friesen
2001-08-28 20:52 ` Jean-Christian de Rivaz
2001-08-28 21:55 ` H. Peter Anvin
3 siblings, 0 replies; 5+ messages in thread
From: Christopher Friesen @ 2001-08-28 20:38 UTC (permalink / raw)
Cc: linux-kernel
Tony Hoyle wrote:
> What I need now is a driver that can read the input from a pin on the
> parallel port and treat it as serial input. It sounds like the kind of
> project that would have been done before, but I can't find anything that
> even comes close. Userspace probably wouldn't cut it as I'm reading as
> 9600 baud and usleep doesn't have nearly enough resolution.
Unless you need to drive this based on interrupts or you need to do other stuff
at the same time, you can use either SCHED_FIFO or SCHED_RR and nanosleep() from
userspace.
According to the man page, nanosleep() will busywait for pauses under 2ms if you
use one of the two realtime schedulers.
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Treating parallel port as serial device
2001-08-28 20:09 Treating parallel port as serial device Tony Hoyle
2001-08-28 20:15 ` Philip Blundell
2001-08-28 20:38 ` Christopher Friesen
@ 2001-08-28 20:52 ` Jean-Christian de Rivaz
2001-08-28 21:55 ` H. Peter Anvin
3 siblings, 0 replies; 5+ messages in thread
From: Jean-Christian de Rivaz @ 2001-08-28 20:52 UTC (permalink / raw)
To: Tony Hoyle; +Cc: linux-kernel
Take a look to the MAX3100 chip:
http://pdfserv.maxim-ic.com/arpdf/MAX3100.pdf
This solution highly reduce the CPU overhead needed to sample Rx line
for each single bit. The chip have a FIFO, an interrupt and look like a
standard UART. Only the bus transfert with the CPU is different.
I curently work on a driver for it.
Regards,
Tony Hoyle wrote:
> I'm looking to attach a serial device to my box that has only TTL level
> I/O. Since I'm more of a software than a hardware person making a
> circuit board up with a max232 in is a bit risky... I want to connect
> the I/O to the parallel port.
>
> What I need now is a driver that can read the input from a pin on the
> parallel port and treat it as serial input. It sounds like the kind of
> project that would have been done before, but I can't find anything that
> even comes close. Userspace probably wouldn't cut it as I'm reading as
> 9600 baud and usleep doesn't have nearly enough resolution.
>
> Tony
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Treating parallel port as serial device
2001-08-28 20:09 Treating parallel port as serial device Tony Hoyle
` (2 preceding siblings ...)
2001-08-28 20:52 ` Jean-Christian de Rivaz
@ 2001-08-28 21:55 ` H. Peter Anvin
3 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2001-08-28 21:55 UTC (permalink / raw)
To: linux-kernel
Followup to: <9mgtpb$mf4$1@sisko.my.home>
By author: "Tony Hoyle" <tmh@nothing-on.tv>
In newsgroup: linux.dev.kernel
>
> I'm looking to attach a serial device to my box that has only TTL level
> I/O. Since I'm more of a software than a hardware person making a
> circuit board up with a max232 in is a bit risky... I want to connect
> the I/O to the parallel port.
>
Most RS232 boards accept TTL level input, so your only problem is
output. You may want to simply construct a level converter, such as a
voltage divider or zener diode on your input.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-08-28 21:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-28 20:09 Treating parallel port as serial device Tony Hoyle
2001-08-28 20:15 ` Philip Blundell
2001-08-28 20:38 ` Christopher Friesen
2001-08-28 20:52 ` Jean-Christian de Rivaz
2001-08-28 21:55 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox