Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looking for Centronics related code

2 views
Skip to first unread message

Xavier

unread,
Nov 13, 2009, 5:28:22 AM11/13/09
to
Hello everybody.
I'm looking for some code (be it basic, C, or assembler, with a
preference for the latter) to talk to the Centronics port on our
machines.
Any documentations, hints are welcome.
I'd like to interface the V6Z80P board with our ARM based computers,
and to do this I need simple (but reliable of course) routines to send
and receive datas via the parallel port.

Cheers,
Xavier.

Martin Wuerthner

unread,
Nov 13, 2009, 6:23:10 AM11/13/09
to
In message <dbc219ab-6d38-4a43...@k19g2000yqc.googlegro
ups.com>
Xavier <xlt...@gmail.com> wrote:

I once implemented data transfer back from printers to RISC OS via the
parallel port as part of an advanced printer error detecting and
reporting system. That was a project for Pace, but unfortunately, the
code was never released because Pace decided to abandon RISC OS
shortly afterwards.

OS_ParallelOp is your friend. It allows you to set the parallel port
registers directly, so you can implement whatever protocol your device
uses. That is going to be difficult low-level driver programming work
though - you need to deal with interrupts and callbacks and you need
to get the timings right (as given in the IEEE parallel port spec).

The main documentation you need is the documentation of your device,
which states which protocol is used to send data from the device to
the host. There is no single standard way of doing so, but it is
likely that the device uses reverse nibble transfer, which RISC OS
does not support by default. As an aside, you can open the parallel
port for input in RISC OS, but the protocol it uses for reading data
will not be suitable for your device.

Sending data to the device is easy - you can use the standard RISC OS
routines. Open "parallel:" and write to it.

Martin
--
---------------------------------------------------------------------
Martin Wuerthner MW Software http://www.mw-software.com/
ArtWorks 2 -- Designing stunning graphics has never been easier
spam...@mw-software.com [replace "spamtrap" by "info" to reply]

Xavier

unread,
Nov 13, 2009, 6:29:30 AM11/13/09
to
On 13 nov, 12:23, Martin Wuerthner <spamt...@mw-software.com> wrote:
> In message <dbc219ab-6d38-4a43-b0b3-361fc6515...@k19g2000yqc.googlegro
> ups.com>
> spamt...@mw-software.com      [replace "spamtrap" by "info" to reply]

Thank you Martin.

The device on the other end is a Z80 computer, with an RS232 port.
I intend to use a bi directionnal RS232 / centronics converter.
The protocol has to be written, as the Z80 computer doesn't offer any
support routines.
Do you know if this kind of transfer is prone to errors ?
Is there some kind of CRC routines to write to correct them ?
Cheers,
Xavier.

Martin Wuerthner

unread,
Nov 13, 2009, 11:53:21 AM11/13/09
to
In message <c6fd09b2-1ce1-4015...@b15g2000yqd.googlegro
ups.com>
Xavier <xlt...@gmail.com> wrote:

> The device on the other end is a Z80 computer, with an RS232 port.
> I intend to use a bi directionnal RS232 / centronics converter.

If you want to communicate with a serial port, why do you want to use
your machine's Centronic port rather than your serial port? That would
make things a lot easier.

As for a bidirectional serial/parallel converter - that sounds like a
very unusual device. Can you give me a pointer where you have seen
that on offer?

Martin
--
---------------------------------------------------------------------
Martin Wuerthner MW Software http://www.mw-software.com/
ArtWorks 2 -- Designing stunning graphics has never been easier

spam...@mw-software.com [replace "spamtrap" by "info" to reply]

Theo Markettos

unread,
Nov 13, 2009, 3:04:11 PM11/13/09
to
Martin Wuerthner <spam...@mw-software.com> wrote:
> OS_ParallelOp is your friend.

ITYM Parallel_Op. Compare with OS_SerialOp. Naming consistency, who needs
it...

Theo

Xavier

unread,
Nov 14, 2009, 6:55:01 AM11/14/09
to
On 13 nov, 17:53, Martin Wuerthner <spamt...@mw-software.com> wrote:
> In message <c6fd09b2-1ce1-4015-aefb-b5d8b1201...@b15g2000yqd.googlegro
> ups.com>

>           Xavier <xlta...@gmail.com> wrote:
>
> > The device on the other end is a Z80 computer, with an RS232 port.
> > I intend to use a bi directionnal RS232 / centronics converter.
>
> If you want to communicate with a serial port, why do you want to use
> your machine's Centronic port rather than your serial port? That would
> make things a lot easier.
>
> As for a bidirectional serial/parallel converter - that sounds like a
> very unusual device. Can you give me a pointer where you have seen
> that on offer?
>
> Martin
> --
> ---------------------------------------------------------------------
> Martin Wuerthner         MW Software      http://www.mw-software.com/
>    ArtWorks 2 -- Designing stunning graphics has never been easier
> spamt...@mw-software.com      [replace "spamtrap" by "info" to reply]

Hi Martin.

The serial port is not implemented on all machines (the A3000 for
example
doesn't have any) and if I'm not wrong there is a bug in the A3xx
series.

If you google a bit with 'RS232 to parallel converter' you can find
this for example :
http://www.airborn.com.au/serial/sertopar.html

Cheers,
Xavier.

Ron

unread,
Nov 14, 2009, 8:10:43 AM11/14/09
to
In message <be7788df-ef72-4771...@o10g2000yqa.googlegroups.com>
Xavier <xlt...@gmail.com> wrote:

> The serial port is not implemented on all machines (the A3000 for
> example
> doesn't have any) and if I'm not wrong there is a bug in the A3xx
> series.
>
> If you google a bit with 'RS232 to parallel converter' you can find
> this for example :
> http://www.airborn.com.au/serial/sertopar.html
>
> Cheers,
> Xavier.

Hi, yes I have a converter here also, but it was quite cheap to buy the
ic to plug into the empty A3000 socket.
The chip is described in the A3000 Technical Referance Manual.

I'm not sure which bug you are referring to, but the early machines used
different wiring on the serial cable.
For a 3 wire connection, it wont be of any concern.

Ron M.

David Holden

unread,
Nov 14, 2009, 8:09:57 AM11/14/09
to

On 14-Nov-2009, Xavier <xlt...@gmail.com> wrote:

> The serial port is not implemented on all machines (the A3000 for
> example doesn't have any) and if I'm not wrong there is a bug in
> the A3xx series.

The A3000 did have a serial port but some of the chips were not fitted as
standard to save money and were supplied as an upgrade.

The 'bug' in the A300 serial port was in the software, not in hardware, and
was only present in Arthur. It was fixed in RO2.

--
David Holden - APDL - <http://www.apdl.co.uk>

Theo Markettos

unread,
Nov 14, 2009, 4:18:52 PM11/14/09
to
David Holden <Spa...@apdl.co.uk> wrote:
> The 'bug' in the A300 serial port was in the software, not in hardware, and
> was only present in Arthur. It was fixed in RO2.

Ahem:
http://www.markettos.org.uk/riscos/docs/RISCOS2/SerialSaga.txt

I'm not sure if the problem usually referred to as the 'bug' is (ha) or
(hd). It was 'fixed' by reassigning the meaning of some of the control
pins, but this meant a special cable. It only affects machines with 6551
chips: A300, A400, A3000, A540, R-series. Some manufacturers' 6551s may
avoid it. Even if you have a functional 6551, OS_SerialOp in RISC OS
2/3.0/3.1 will assume you're using the special cable.

Theo

David Holden

unread,
Nov 15, 2009, 3:20:04 AM11/15/09
to

The article is dated 1988, a year before the introduction of RO2 and
describes the various software patches for Arthur. AFAIK RO2 had a
'workaround' for the problem which made it transparent to users as long as
they used the standard OS routines.

It's a long time ago so I'm not sure of the details but I know I wrote
software to connect a Z88 to the A310 and had no problems with handshaking
at 9,600 baud with RO2 using the usual CTS/RTS connections.

Xavier

unread,
Nov 16, 2009, 5:15:50 AM11/16/09
to
On 15 nov, 09:20, "David Holden" <Spam...@apdl.co.uk> wrote:
> On 14-Nov-2009, Theo Markettos <theom+n...@chiark.greenend.org.uk> wrote:

Hello David.
Would you be ok to make the source code available so that I try to
connect to
the v6z80p board ?
Cheers,
Xavier.

0 new messages