[GreenKeys] Model 15 C-64 rate question

drlegendre . drlegendre at gmail.com
Mon Jul 6 17:11:19 EDT 2015


@John & All

Interesting.. I have two different versions of the Commodore 64
Programmer's Reference Guide here. One notes that the opt baud low / high
feature is "NI" while the other makes no such notation. Interestingly, both
versions give the formulas for determining their values..

But it seems that the feature may in fact be working, at least on the
particular machine I'm using - though I haven't gotten far enough along to
be able to measure the baud rate. As for measuring it, can I do something
as silly as have the machine send a continuous string of
(start)+chr$(21)+(stop) (binary 10101010) and measure the rate / period
with a freq. counter? Set it for 6 data bits, 1 stop, no parity, etc.

Also, I worked through the math and you & I get different results. For
45.45 baud I'm getting 143 / 43 vs. 139 / 43 from your example..

It also seems that I've solved the overheating issue with the MAX232 chip.
One manufacturer's data indicates that the 'rail' cap on Pin 2 can have the
(-) end connected to either GND or VCC, makes no difference. Mine was
connected to GND, but moving it to VCC made all the difference - no more
insane, instant overheating. I have no idea why that should make any
difference, but it does!

These chips also have the 'bug' of the missing internal 400K pull-up
resistors on the TTL inputs, but adding them didn't help.

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/20150706/74df91d5/attachment.html>


More information about the GreenKeys mailing list