uhiuhui

This C64 page is

UNDER CONSTRUCTION

Prologue

How it started

C64/C128 description

HW projects

Links

www.zincica.de



Prologue

This page is dedicated to Commodore C64, the best computer ever (my opinion :-). There are several hardware projects I started to develop, but I never finished them; mainly because lack of time. C64 was my first computer; the Amiga 500, Amiga 4000/30 and several different PCs followed later.

To be continued, under construction...

How it started

I had only few games for my Commodore, so I tried to write my own programs in C64 basic, and later, in 6502 assembler (because of performance and better graphic programming possibilities). My father bought (I was 10 years old) several books about C64's graphics and sound low level programming; so I started to try it. I was curious and I had all time of the world (in Tunis, there was no school at embassy and visiting one of the French schools was dangerous because of possible “ideological manipulation” of young brave Slovak “pioneers”); however the yearly hard examen waited to me and to my sister in our home country at our regular school, so learning (with our mother as teacher) was necessary -> but this was REALLY low price for high grade of freedom :-)

So I started to write programs in BASIC and in assembler, just for fun. Now I am doing the same thing (not in BASIC!), but for living (a big piece of fun is still there, of course).

C64/C128 description

May be it is unnecessary to describe these famous computers here, a plenty of informations can be found on the internet, but I try it anyway with some brief infos:

1. Commodore 64

Processor

6502 @ ~1Mhz (PAL/NTSC are a bit different)

RAM

64 Kb, 16 Kb addressed by VIC

ROM


VIC (video)

16 predefined colors palette

Normal text mode 40x25 characters (256 characters displayable @ 2 colors/character)

Multicolor text mode 40x25 characters (64 characters displayable @ 8 colors/character)

Hires bitmap 320x200, 2 colors per 8x8 pixels area)

Multicolor bitmap 160x200, 8 colors per 4x8 pixels area)

8 hardware sprites (24x21 pixel, double height/width ability, multicolor ability, collision detection)

Light pen support

... and many other non documented display modes and timing tricks.

SID (sound)

3 channels, 3 signal envelopes programmable on each channel

2 x CIA (IO)


To be continued, under construction...










2. Commodore 128D

To be continued, under construction...

HW projects

1. RS232 and Centronics interface connected to serial port of C64

Idea is to build the device containing the unidirectional parallel port and one (or several) bidirectional RS232 interfaces connected to serial port of C64/C128 without any ROM changes and/or patches. The serial port of C64 is terribly slow and some kind of buffering will be needed in hardware (some bytes are enough), additionally hardware flow control has to be implemented to avoid buffer overruns. For parallel port the device address 4 (printer) will be used. RS232 ports have to be mapped as “second” floppy disk (optional device addresses 8 or 9). Normal BASIC/kernel function “OPEN” has to be used to access the RS232 port(s), where communication direction/speed has to be passed as secondary address and/or pseudo sequential “filename” “opened” on the simulated floppy disk drive.

First problem is to handle the C64 serial protocol. It uses crucial timings to manage the communication. I decided to use Atmega8 8 bit RISC micro controller from Atmel; it has UART and enough IO pins needed to implement the parallel port and it is fast enough (theoretically) to handle the micro second(s) timings of the bus when clocked @20 MHz. Additionally the ATmega8 contains a multichannel A/D and one PWM output -> our new device can provide this functionality too.

Now I needed the development environment for AVR micro controllers. Formerly I used PICs from Microchip, but I abandoned this platform and changed to AVR. There are several reasons for this, but they are not important now... I purchased all needed electronic pieces at www.reichelt.de and installed the gcc AVR development environment as described here. All worked perfectly (flashing of the AVR using avrdude, C compiler). GNU C compiler is very good, but time critical handshaking of the C64 serial bus will be written in assembler – just to be defensive.

So, at this point I had the idea and I started to gather all possible informations and data sheets about C64's serial protocol. As awaited, most useful internet addresses are google and wikipedia. Very much infos and links needed can be found on the old good Fairlight home page here. Very useful are the sources of disk drive emulator for PC; actually I used these sources to understand how the communication works and probably I will use them to implement the access to “pseudo” files/channels, which will represent input and output of the RS232. I can say, it was NOT easy to persuade the Atmega8 to communicate with C64, but after several hours of try and fail I was able to observe the communication on the serial bus and to answer to printer (address 4) requests “almost” correctly.

To be continued, under construction...



2. Two unipolar 4 phase step motors controller connected to serial port of C64

To be continued, under construction...

Last changed 2007-05-19. Send critics/suggestions to: webadmin@zincica.de