[GreenKeys] Model 15 C-64 rate question

drlegendre . drlegendre at gmail.com
Sun Jul 5 22:49:42 EDT 2015


John,

Ok thanks - but a couple of things, here..

>From what I've read, those "user" baud rates (in the third and fourth
command bytes) are supposedly not implemented. There was intent to do so,
but the functionality isn't there.. or so I have read. Also, I'm pretty
sure the string needs to be sent as CHR$(244)+CHR$(16)+CHR$(139)+CHR$(43)
vs. integer values in ACSII.

But setting all that aside, I can't see how the TTY will cope with the
character frames sent by the C-64. I see that you are setting 5 DATA bits
and 2 STOP bits, but isn't the frame still 8 bits long (including 1 START
bit)? Isn't the TTY code 5 DATA bits plus 1 each STOP and START, for a
total of 7 bits?

Seems like they'd fall out of sync after the first character. Last bit of
the first character sent from the C-64 would become the first bit of the
next character for the TTY, wouldn't it?

On Sun, Jul 5, 2015 at 2:54 PM, John Nagle <nagle at animats.com> wrote:

> On 07/04/2015 11:33 AM, drlegendre . wrote:
>>
>>>
>>> >>Thinking about trying to use a C-64 to communicate with a model 15 that
>>> >>should be arriving in a couple of months. The native RS-232 routine on
>>> >>the Commodore has a minimum baud rate of 50, whereas the 15 wants 45.45
>>> >>or so I've heard.
>>> >>
>>> >>Will the 15 tolerate 50 baud? FWIW the C-64 routine sets a pair of
>>> >>256-byte FIFO I/O buffers for RS-232 communications, not sure how that
>>> >>might come into play.
>>> >>
>>> >>If it can't take continuous data at 50 baud, what if I only send one
>>> >>character at a time, with a slight delay such that the total CPM
>>> doesn't
>>> >>exceed the max char rate of 50 baud? IOW, can it take one character's
>>> >>worth of bits a little faster, so long as the next character doesn't
>>> >>arrive too soon?
>>> >>
>>> >>Thanks for any input.
>>>
>>
>    The speed tolerance of a model 15 is about 7%, so it might work.
> But you can easily set the baud rate for a Commodore 64 to 45 baud.
> See page 350 of the manual, for the Open command.
>
>
> http://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference_guide-06-input_output_guide.pdf
>
> OPEN Ifn,2,O,"<control register> <command register> <opt baud low> <opt
> baud high>"
>
> "If the lower 4 bits of the baud rate is equal to 0, the
> <opt baud low> <opt baud high> characters give you a rate
> based on the following:
>
>   <opt baud low>=<system frequency/rate/2-100-<opt baud high>*256
>
>   <opt baud high>=INT(<system frequency/rate/2-100)/256)
>
>   System frequency is 1.02273E6 for US NTSC units and
>   O.98525E6 for European PAL units.
>
> So, for an NTSC unit,
>
>   <system frequency>/rate/2-100
> = 1022730/45.45/2-100
> = 11147
>
> which is the clock divisor to be used.
>
> The basic concept in classic UARTs is that there's a "divisor" and a
> counter driven from the system clock. The counter counts at the
> system clock rate until it is equal to the divisor registor. Then
> the  UART does a bit cycle and the counter resets.
> The clock divisor is fed to the UART as two bytes, because this
> is a machine with an 8-bit bus width.
>
>   <opt-baud-high> = INT(divisor/256) = 43
>   <opt-baud-low> = divisor - <opt-baud-high>*256 = 139
>
> The "control register" should be 1110000 binary, for
> 2 stop bits, 5 data bits, user-selected speed.
> This is decimal 224.
>
> The "command register" should be 00010000, for
> no parity, full duplex, no handshake.
> This is decimal 16.
>
> So try
>
> OPEN 1,2,O,"224 16 139 43"
>
> which should give you a 45.45 baud 5 bit no parity
> full duplex serial port as file #1.
>
> This is untested, but it's all in the manual.
>
>                                 John Nagle
> ______________________________________________________________
> GreenKeys mailing list
> Home: http://mailman.qth.net/mailman/listinfo/greenkeys
> Help: http://mailman.qth.net/mmfaq.htm
> Post: mailto:GreenKeys at mailman.qth.net
>
> 2002-to-present greenkeys archive:
> http://mailman.qth.net/pipermail/greenkeys/
> 1998-to-2001 greenkeys archive:
> http://mailman.qth.net/archive/greenkeys/greenkeys.html
> Randy Guttery's 2001-to-2009 GreenKeys Search Tool:
> http://comcents.com/tty/greenkeyssearch.html
>
> This list hosted by: http://www.qsl.net
> Please help support this email list: http://www.qsl.net/donate.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qth.net/pipermail/greenkeys/attachments/20150705/6c9f89c6/attachment.html>


More information about the GreenKeys mailing list