Well, when you connect a modem to the userport on a C= computer, it is
serial right? (not parallel) So which pins on the userport are used
for serial data transfer?
Now here is the next question. Exactly what causes the 2400 baud
limitation in the C64? Is there a limit to how fast an I/O pin can be
toggled on and off? Or is it something to do with the process of
converting parallel data to serial data? Also is the 2400 baud
limitation a problem in both directions, or just one? I've actually
heard some people say that it is limited to slightly less than 2400,
such as 2300 or something like that.
The main reason I want to know, is I'm getting ready to interface my
Commodore DTV's userport to some serial devices such as a picaxe (they
run at 5V, so it should not be a problem) and to make it easy I thought
maybe at first I could just use a typical ASCII terminal program. Once
I'm sure the connection is going, I could then work on my own software
to interface. But the DTV only has PB0 through PB7, it doesn't have any
of those other pins. A lot of these microcontroller devices are
hard-set at 2400. I am curious if I'll be able to talk to it. There
won't be much data going across, just a few characters per second. So
there won't be a big buffering issue.
Indeed.
> Well, when you connect a modem to the userport on a C= computer, it is
> serial right? (not parallel) So which pins on the userport are used
> for serial data transfer?
I think you're confusing two things here. The CIA contains a shift
register, which can be used for serial input and output. It is connected
to port pins SP (data) and CNT (clock). The C-64's RS232 implementation,
however, does not use this register; it's done entirely in software,
using PBx, PA2 and /FLAG2. The pin assignments is given in the
Programmer's Reference Guide, page 348,which you can find online at
Project 64.
> Now here is the next question. Exactly what causes the 2400 baud
> limitation in the C64?
The fact that the RS232 implementation is done in software, combined
with the computer's clock speed.
> Is there a limit to how fast an I/O pin can be toggled on and off?
Yes. However, that limit is much higher; it should be at the order of
magnitude of 100kHz.
> The main reason I want to know, is I'm getting ready to interface my
> Commodore DTV's userport
Careful there. The DTV is no C-64; I have no idea how complete the CIA
implementation of the DTV is.
> Once
> I'm sure the connection is going, I could then work on my own software
> to interface. But the DTV only has PB0 through PB7,
Which means you're lacking TxD, which is assigned to PA2. However, you
probably won't need some of the other serial lines, so you might be able
to rewrite the kernal routines, or write your own serial routines.
Michael
This sounds like all we need is a GEOS driver and a correctly wired
RS-232 adapter to do high(er) speed serial I/O, and that, at to a
certain point, a Turbo-232 might not be nececary. That would be nice,
since there are a lot of other things some of us might want in the
cartridge port.
Do you know what the CIA's real serial hardware speed limit is? How
hard would it be to write a GEOS driver?
shift speed is CLK/4, so 250,000 bps, roughly.
But, you have to add NMI delay, etc.
After all is said and done, you can get 9600 bps out of the CIA shift
register, which is what Daniel Dallmann's UP9600 interface does (it uses
the CIA shift registers for in and outbound traffic. The limiting
factor was NMI servicing, as I recall.
If you are in a specialized situation (you can devote more time to
handling data, no need to update a screen, no disk traffic, etc., then
you can go to higher speeds.
Jim
NOt quite a few, just a few. All that is common is the 7 IO lines,a s I
recall. FOr the 64/128 line, there is:
D0-D7
RESET
CNT1/SP1 (Shift register)
CNT2/SP2 (Shift register 2)
ATN
FLAG2
PA2
ON the VIC:
d0-7
joy0,1,2
Light Pen
cassette switch
CB1
CB2
You actually get more IO on the VIC and PET lines, as the shift
registers are not there.
> Now here is the next question. Exactly what causes the 2400 baud
> limitation in the C64? Is there a limit to how fast an I/O pin can be
> toggled on and off? Or is it something to do with the process of
> converting parallel data to serial data? Also is the 2400 baud
> limitation a problem in both directions, or just one? I've actually
> heard some people say that it is limited to slightly less than 2400,
> such as 2300 or something like that.
The stock routines are flaky at 2400, but the Hug routines are rock
solid. As noted by another poster, the slowdown is the need to do all
the bit-stuffing in SW.
> The main reason I want to know, is I'm getting ready to interface my
> Commodore DTV's userport to some serial devices such as a picaxe (they
> run at 5V, so it should not be a problem) and to make it easy I thought
> maybe at first I could just use a typical ASCII terminal program. Once
> I'm sure the connection is going, I could then work on my own software
> to interface. But the DTV only has PB0 through PB7, it doesn't have any
> of those other pins. A lot of these microcontroller devices are
> hard-set at 2400. I am curious if I'll be able to talk to it. There
> won't be much data going across, just a few characters per second. So
> there won't be a big buffering issue.
You'll need FLAG2 (pin B on the User port), or else you won't see the
start bits of the data coming in.
Jim
> All that is common is the 7 IO lines, as I recall.
> For the 64/128 line, there is:
>
> D0-D7, RESET, CNT1/SP1, CNT2/SP2, ATN, FLAG2, PA2
>
> ON the VIC:
>
> d0-7, joy0,1,2, Light Pen, cassette switch, CB1, CB2
At least the reset pin is connected on the VIC too. My userport
reset button utilizes it. The users manual lists the following
pins:
Pin VIC C64
--- --- ---
1 GND GND
2 +5V +5V
3 RESET RESET
4 JOY0 CNT1
5 JOY1 SP1
6 JOY2 CNT2
7 L PEN SP2
8 CAS SW PC2
9 SERATN SERATN
10 +9V +9V
11 GND +9V
12 GND GND
A GND GND
B CB1 FLAG2
C PB0 PB0
D PB1 PB1
E PB2 PB2
F PB3 PB3
H PB4 PB4
J PB5 PB5
K PB6 PB6
L PB7 PB7
M CB2 PA2
N GND GND
I don't have access to PET, Plus/4 or C128 manuals, and I don't know
what the functional difference is between CB1 + CB2 and FLAG2 + PA2.
--
Anders Carlsson