Re: RS-232 on VIC-20

From: Marko Mäkelä (
Date: 2004-06-30 23:35:55

On Wed, Jun 30, 2004 at 10:03:04PM +0200, Christian Johansson wrote:
> > No.  In 2 MHz mode, there are no badlines, but the system will run at 1 MHz
> > during memory refresh (5 slow cycles on every rasterline), making the total
> > number of cycles per raster line equal 63*2-5 on PAL systems and 65*2-5 on
> > NTSC.

> Does this only apply if the 40-column screen is used in 2 MHz mode,
> i.e. the system runs at 2 MHz all the time if using 80-column mode in 2 MHz
> mode?

The VIC-IIe can never be fully disabled from the C128.  It generates the
processor clock and produces the 40-column video signal all the time.
I'm not aware of a way to disable the 5 memory refresh cycles per raster line.
(Note that the VDC raster lines are not synchronized with the VIC-IIe raster
lines, as the two video chips use different dot clock sources.)

> > You may need to take the DRAM refresh cycles into consideration.  The bit
> time
> > for 4800 bps is 17734472/18/4800 = 205 slow cycles on the PAL C128 and
> > 14318181/14/4800 = 213 slow cycles on the NTSC C128.  Okay, maybe you can
> > ignore the DRAM refresh even at 9600 bps.
> Forgive me my ignorance but does this mean that the system clock
> frequency on a PAL machine is derived from an oscillator running at 17734472
> Hz that is divided by 18 by a clock divider (I guess this is described
> somewhere in the C64 Programmer's Reference Guide but I can't find it right
> now)?

It's not described in the Programmer's Reference Guide, but you have to
deduce it from the schematic diagram.  Be sure not to use the PRG's buggy
schematic diagram, but a more accurate one, e.g., from

> I think that your calculations may not be correct for the Hug routine.
> These are the values used by that routine and they are different from what I
> get with your calculations:
> ;       Start bit times.
> ;
> strt24  .word   459     ; 2400
> strt12  .word   1090    ; 1200
> strt03  .word   4915    ;  300
> ;
> ;       Full bit times.
> ;
> full24  .word   421     ; 2400
> full12  .word   845     ; 1200
> full03  .word   3410    ;  300

If you multiply the above figures, e.g., 421*2400, you should get the
processor clock speed in Hz.  Most figures are around 1.1 MHz.  The
PAL VIC-20 clock speed is 17734472 Hz/16 (and not /18 as on the C64 and C128),
or 1108404 Hz.  So, the figures look quite okay.

On the PAL C64 and C128, you should use 985248 Hz as the base value.
If I remember correctly, the NTSC VIC-20 runs at the same clock speed
as the NTSC C64 and C128, 14318181 Hz/14=1022727 Hz.


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.