Plus/4 RS232 woes

classic Classic list List threaded Threaded
54 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Plus/4 RS232 woes

Bo Zimmerman
Hello all,

After check both(!) books on Plus/4 programming, and the 6551 schematic,
and doing experimenting... I have a question.  Does anyone know the
kosher way to change the user port RTS signal so that the modem knows to
stop transmitting data while a program catches up?  I'm initializing the
Command Register to 5 (RTS low/enabled, DTR enabled, IRQ, no party, no
echo).  But bad things seem to happen when I attempt to touch it again
to change RTS to high/disabled.  Does anyone have any knowledge or
experience with this?

- Bo






smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
On 03/09/2018 08:49, Bo Zimmerman wrote:
> But bad things seem to happen when I attempt to touch it again to
> change RTS to high/disabled.

What bad things?

Figure 7 on page 7 of the data sheet suggests that when RTS is high then
something happens to transmission.

http://archive.6502.org/datasheets/mos_6551_acia.pdf

Half duplex uses RTS to mean "I'm ready to send" (hence the name), full
duplex uses RTS to mean "I'm ready to receive".

The 6551 may have been designed for half duplex.


Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

André Fachat
In reply to this post by Bo Zimmerman
Hi Bo,

Am 3. September 2018 09:52:20 schrieb Bo Zimmerman <[hidden email]>:

> Hello all,
>
> After check both(!) books on Plus/4 programming, and the 6551 schematic,
> and doing experimenting... I have a question.  Does anyone know the
> kosher way to change the user port RTS signal so that the modem knows to
> stop transmitting data while a program catches up?  I'm initializing the
> Command Register to 5 (RTS low/enabled, DTR enabled, IRQ, no party, no
> echo).  But bad things seem to happen when I attempt to touch it again
> to change RTS to high/disabled.  Does anyone have any knowledge or
> experience with this?

In my experience the rts/cts/dtr lines are completely broken in the ACIA.

They switch off rx and/or tx at inconvenient times and in the middle of
transactions.

So no, I don't know a good wayof using them, sorry

André

> - Bo
>
>
>
>
>
>



smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
On 03/09/2018 09:14, André Fachat wrote:
>
> They switch off rx and/or tx at inconvenient times and in the middle
> of transactions.
>
> So no, I don't know a good wayof using them, sorry
>
If it turns off transmit in the middle of sending a byte then you could
try waiting until the transmit buffer is empty before disabling it,
although I can't see why it would stop immediately. From reading the
description in the datasheet I would assume it would finish sending but
no longer generate an interrupt to say the buffer is empty. It's
annoying that you can't send just because you haven't been able to
process the data you received yet. You would certainly need to make sure
your protocol avoids deadlocks.

Ironically I can't see any reason in the datasheet why changing the RTS
line would affect receiving.


Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Gerrit Heitsch
In reply to this post by André Fachat
On 09/03/2018 10:14 AM, André Fachat wrote:

> Hi Bo,
>
> Am 3. September 2018 09:52:20 schrieb Bo Zimmerman <[hidden email]>:
>
>> Hello all,
>>
>> After check both(!) books on Plus/4 programming, and the 6551 schematic,
>> and doing experimenting... I have a question.  Does anyone know the
>> kosher way to change the user port RTS signal so that the modem knows to
>> stop transmitting data while a program catches up?  I'm initializing the
>> Command Register to 5 (RTS low/enabled, DTR enabled, IRQ, no party, no
>> echo).  But bad things seem to happen when I attempt to touch it again
>> to change RTS to high/disabled.  Does anyone have any knowledge or
>> experience with this?
>
> In my experience the rts/cts/dtr lines are completely broken in the ACIA.
>
> They switch off rx and/or tx at inconvenient times and in the middle of
> transactions.
>
> So no, I don't know a good wayof using them, sorry

I only know about CTS being broken, it will turn off the transmitter in
the middle of a byte and that's why the CTS line of the 6551 in the
Plus/4 is connected to GND.

RTS is an output and tells the other side that you are ready to receive
data.

  Gerrit


Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

André Fachat


Am 3. September 2018 16:48:23 schrieb Gerrit Heitsch
<[hidden email]>:

> On 09/03/2018 10:14 AM, André Fachat wrote:
>> Hi Bo,
>>
>> Am 3. September 2018 09:52:20 schrieb Bo Zimmerman <[hidden email]>:
>>
>>> Hello all,
>>>
>>> After check both(!) books on Plus/4 programming, and the 6551 schematic,
>>> and doing experimenting... I have a question.  Does anyone know the
>>> kosher way to change the user port RTS signal so that the modem knows to
>>> stop transmitting data while a program catches up?  I'm initializing the
>>> Command Register to 5 (RTS low/enabled, DTR enabled, IRQ, no party, no
>>> echo).  But bad things seem to happen when I attempt to touch it again
>>> to change RTS to high/disabled.  Does anyone have any knowledge or
>>> experience with this?
>>
>> In my experience the rts/cts/dtr lines are completely broken in the ACIA.
>>
>> They switch off rx and/or tx at inconvenient times and in the middle of
>> transactions.
>>
>> So no, I don't know a good wayof using them, sorry
>
> I only know about CTS being broken, it will turn off the transmitter in
> the middle of a byte and that's why the CTS line of the 6551 in the
> Plus/4 is connected to GND.
>
> RTS is an output and tells the other side that you are ready to receive
> data.

According to my Rockwell data handbook, if you set RTS inactive via the
command register, it disables the Transmitter.

Bummer.

André
>
>   Gerrit
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Mike Stein

----- Original Message -----
From: "André Fachat" <[hidden email]>
To: <[hidden email]>
Sent: Monday, September 03, 2018 11:06 AM
Subject: Re: Plus/4 RS232 woes


>
> According to my Rockwell data handbook, if you set RTS inactive via the
> command register, it disables the Transmitter.
>
> Bummer.
>
---
Why would you 'change your mind' to say you're not Ready To Send while you're actually sending a character, without waiting for the character to be completely sent?

m

Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Mike Stein
In reply to this post by smf

----- Original Message -----
From: "smf" <[hidden email]>
To: <[hidden email]>
Sent: Monday, September 03, 2018 4:04 AM
Subject: Re: Plus/4 RS232 woes


> Half duplex uses RTS to mean "I'm ready to send" (hence the name), full
> duplex uses RTS to mean "I'm ready to receive".
---
And exactly how do you select this?

>
> The 6551 may have been designed for half duplex.
---
So the datasheet is wrong when it says that it can do both full- and half-duplex?



smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
In reply to this post by Mike Stein
On 03/09/2018 17:26, Mike Stein wrote:
> Why would you 'change your mind' to say you're not Ready To Send while you're actually sending a character, without waiting for the character to be completely sent?

In full duplex RTS means I am ready to receive, nothing to do with
sending (despite the name). So normally you start out with it low, then
when you receive a character and your buffer is getting full, you raise
RTS to tell the other end to stop sending (most UARTS at least have the
flow control seemingly the wrong way round). If the 6551 disables the
transmitter immediately, then you obviously have to wait until the next
character time before you drop RTS.

In half duplex you only raise RTS when you have data to send and wait
for CTS to be given in response. It seems 6551 is designed for this
scenario, rather than full duplex flow control.


Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

André Fachat
In reply to this post by Mike Stein


Am 3. September 2018 18:29:49 schrieb "Mike Stein" <[hidden email]>:

>
> ----- Original Message -----
> From: "André Fachat" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, September 03, 2018 11:06 AM
> Subject: Re: Plus/4 RS232 woes
>
>
>>
>> According to my Rockwell data handbook, if you set RTS inactive via the
>> command register, it disables the Transmitter.
>>
>> Bummer.
>>
> ---
> Why would you 'change your mind' to say you're not Ready To Send while
> you're actually sending a character, without waiting for the character to
> be completely sent?

As it seems the ACIA is made for half duplex. Just read some more. The ACIA
requests to send to the modem, and the modem answers with CTS when the ACIA
is allowed to send.

This collides with my full duplex understanding of Hardware handshaking.
Where RTS allows the ACIA to signal to the other side that it is ready to
receive (request the other side to send) while CTS allows the other side to
keep the ACIA from sending, so that you can have two ACIAs connected with
crossed over RTS/CTS connections.

André

>



Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

André Fachat
In reply to this post by Mike Stein


Am 3. September 2018 18:30:12 schrieb "Mike Stein" <[hidden email]>:

>
> ----- Original Message -----
> From: "smf" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, September 03, 2018 4:04 AM
> Subject: Re: Plus/4 RS232 woes
>
>
>> Half duplex uses RTS to mean "I'm ready to send" (hence the name), full
>> duplex uses RTS to mean "I'm ready to receive".
> ---
> And exactly how do you select this?

As far as I understand the specs you can't with the ACIA.

André
>
>>
>> The 6551 may have been designed for half duplex.
> ---
> So the datasheet is wrong when it says that it can do both full- and
> half-duplex?
>
>
>



smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
In reply to this post by Mike Stein
On 03/09/2018 17:27, Mike Stein wrote:
>> Half duplex uses RTS to mean "I'm ready to send" (hence the name), full
>> duplex uses RTS to mean "I'm ready to receive".
> ---
> And exactly how do you select this?

Most UARTS the flow control lines are just IO pins that have no impact
on the transmitter or receiver. This has pro's and con's, but the main
advantage is they don't have to support all the crazy different flow
control methods out there. Some systems uses DTR/DSR for flow control.
You select it purely by writing code.

On the 6551 you don't select it, it's hardcoded and can't be overridden.
You are stuck with it.

> So the datasheet is wrong when it says that it can do both full- and
> half-duplex?

It can do full duplex transmission without hardware flow control. You
would have to use some CIA bits for RTS/CTS instead if you wanted to
handle all situations.



smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
In reply to this post by Gerrit Heitsch

On 03/09/2018 15:46, Gerrit Heitsch wrote:
> I only know about CTS being broken, it will turn off the transmitter
> in the middle of a byte and that's why the CTS line of the 6551 in the
> Plus/4 is connected to GND.
>
It's not so much broken as doesn't mean what the majority want it to.

If you're using RS485 multidrop and you lose CTS then you need to stop
sending immediately or you'll get a network collission, putting that
logic in the UART was however a mistake.

> RTS is an output and tells the other side that you are ready to
> receive data.

In half duplex world RTS it really means ready to send.

https://www.logic-control.com/datasheets/4/Tech%20Note/The%20Secrets%20of%20RS-485%20Half%20Duplex%20Communication.pdf


smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
In reply to this post by Gerrit Heitsch
On 03/09/2018 15:46, Gerrit Heitsch wrote:
>
> I only know about CTS being broken, it will turn off the transmitter
> in the middle of a byte and that's why the CTS line of the 6551 in the
> Plus/4 is connected to GND.
>
The VIC-1011 RS232 adapter (which the plus 4 user port seems to have
been designed around) uses one of the 6529 bits for CTS.

K is CTS, but it goes to 6529 P1

http://www.zimmers.net/anonftp/pub/cbm/schematics/cartridges/userport/1011005.gif

http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/plus4/connectors-1.jpg

So the main problem is that you should wait until the transmitter is
empty before signalling to the other end to stop sending data, it will
have the effect of stopping you being able to send as well though.

They should have used a 6529 pin for RTS as well. You could add the
option of using that with a hardware modification.



Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

MiaM
In reply to this post by André Fachat
Den Mon, 03 Sep 2018 10:14:53 +0200 skrev André Fachat <[hidden email]>:

> Hi Bo,
>
> Am 3. September 2018 09:52:20 schrieb Bo Zimmerman <[hidden email]>:
>
> > Hello all,
> >
> > After check both(!) books on Plus/4 programming, and the 6551
> > schematic, and doing experimenting... I have a question.  Does
> > anyone know the kosher way to change the user port RTS signal so
> > that the modem knows to stop transmitting data while a program
> > catches up?  I'm initializing the Command Register to 5 (RTS
> > low/enabled, DTR enabled, IRQ, no party, no echo).  But bad things
> > seem to happen when I attempt to touch it again to change RTS to
> > high/disabled.  Does anyone have any knowledge or experience with
> > this?
>
> In my experience the rts/cts/dtr lines are completely broken in the
> ACIA.
>
> They switch off rx and/or tx at inconvenient times and in the middle
> of transactions.
>
> So no, I don't know a good wayof using them, sorry

The A2232 7-port serial card for Amiga uses the 6551 and it seems to
think that CTS and DCD is really broken and uses a separate 8520 CIA
instead of the 6551's for those signals.

Btw this is probably well known but there is an alternative driver
available on Aminet which afaik is a complete rewrite, making that card
able to run at 115200 on it's fist two ports with no data loss and
almost no cpu load on the Amiga.

--
(\_/) Copy the bunny to your mails to help
(O.o) him achieve world domination.
(> <) Come join the dark side.
/_|_\ We have cookies.

Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Gerrit Heitsch
On 09/03/2018 10:08 PM, Mia Magnusson wrote:
>
> The A2232 7-port serial card for Amiga uses the 6551 and it seems to
> think that CTS and DCD is really broken and uses a separate 8520 CIA
> instead of the 6551's for those signals.
>
> Btw this is probably well known but there is an alternative driver
> available on Aminet which afaik is a complete rewrite, making that card
> able to run at 115200 on it's fist two ports with no data loss and
> almost no cpu load on the Amiga.

Back then I recommended a hardware hack... Bend then XTAL-Pins of the
8551 or 6551 from the Socket and solder a 3.6864 MHz crystal to it. Yes,
that was overclocking the chip, but this way you were able to get 38400
on one or two ports without any changes to the software. You just needed
to remember that real baudrate would be double of what you selected in
the software.

  Gerrit


Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Jim Brain
On 9/4/2018 11:34 AM, Gerrit Heitsch wrote:
On 09/03/2018 10:08 PM, Mia Magnusson wrote:

The A2232 7-port serial card for Amiga uses the 6551 and it seems to
think that CTS and DCD is really broken and uses a separate 8520 CIA
instead of the 6551's for those signals.

Btw this is probably well known but there is an alternative driver
available on Aminet which afaik is a complete rewrite, making that card
able to run at 115200 on it's fist two ports with no data loss and
almost no cpu load on the Amiga.

Back then I recommended a hardware hack... Bend then XTAL-Pins of the 8551 or 6551 from the Socket and solder a 3.6864 MHz crystal to it. Yes, that was overclocking the chip, but this way you were able to get 38400 on one or two ports without any changes to the software. You just needed to remember that real baudrate would be double of what you selected in the software.

 Gerrit


If folks are interested, I created a "daughtercard" for the 6551/8551 that allows the X551 to configure for bos rates 230K, 115.2K, 57.6K, 38.4K, and the original speeds.  It sits in the X551 socket and the X551 sits on the unit.  It requires no flying leads and is configured using the same registers as the original X551.

Jim


-- 
Jim Brain
[hidden email] 
www.jbrain.com
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

MiaM
In reply to this post by Gerrit Heitsch
Den Tue, 4 Sep 2018 18:34:08 +0200 skrev Gerrit Heitsch
<[hidden email]>:

> On 09/03/2018 10:08 PM, Mia Magnusson wrote:
> >
> > The A2232 7-port serial card for Amiga uses the 6551 and it seems to
> > think that CTS and DCD is really broken and uses a separate 8520 CIA
> > instead of the 6551's for those signals.
> >
> > Btw this is probably well known but there is an alternative driver
> > available on Aminet which afaik is a complete rewrite, making that
> > card able to run at 115200 on it's fist two ports with no data loss
> > and almost no cpu load on the Amiga.
>
> Back then I recommended a hardware hack... Bend then XTAL-Pins of the
> 8551 or 6551 from the Socket and solder a 3.6864 MHz crystal to it.
> Yes, that was overclocking the chip, but this way you were able to
> get 38400 on one or two ports without any changes to the software.
> You just needed to remember that real baudrate would be double of
> what you selected in the software.

On my A2232, the oscillator were socketed, or maybe I actually
desoldered the original and installed a socket. However I hadn't any
3.6xx crystal but I had one at twice that frequency, and that worked
well for me.

But then I found that driver on Aminet and it worked far better, and I
installed the original crystal instead and used 115200.

--
(\_/) Copy the bunny to your mails to help
(O.o) him achieve world domination.
(> <) Come join the dark side.
/_|_\ We have cookies.

smf
Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

smf
On 04/09/2018 18:32, Mia Magnusson wrote:
> But then I found that driver on Aminet and it worked far better, and I
> installed the original crystal instead and used 115200.

This is from memory when I added support for this to mame as some apple
3 software used it.

The 6551 can work from an external crystal (XTAL1/XTAL2) to drive an on
board clock generator for asynchronous or an external TxC (XTAL1) for
synchronous comms.

However if you turn off the on board clock generator then the 1.8mhz
crystal gets divided down by 16 and you get 115200.

I have no idea if the chip designer would have a fit or not, it's
certainly not clear from the documentation that it should work at all.



Reply | Threaded
Open this post in threaded view
|

Re: Plus/4 RS232 woes

Jim Brain
On 9/4/2018 2:09 PM, smf wrote:
On 04/09/2018 18:32, Mia Magnusson wrote:
But then I found that driver on Aminet and it worked far better, and I
installed the original crystal instead and used 115200.

This is from memory when I added support for this to mame as some apple 3 software used it.

The 6551 can work from an external crystal (XTAL1/XTAL2) to drive an on board clock generator for asynchronous or an external TxC (XTAL1) for synchronous comms.

However if you turn off the on board clock generator then the 1.8mhz crystal gets divided down by 16 and you get 115200.

I have no idea if the chip designer would have a fit or not, it's certainly not clear from the documentation that it should work at all.



It works as designed.  /16 mode gives 115200.  The T232 used this to get 115200 and 230400 (by using the 6551A and double clocking it)

JIm

-- 
Jim Brain
[hidden email] 
www.jbrain.com
123