8563-80 COLUMN CHIP by Bill Pytlovany There is 16K of memory in the 8563 chip which is not considered as part of the 128K of the C128 PC. This memory is intended to be used solely by the 8563 80-column chip. Much of it is relocatable areas but these are the default definitions. 0000 - 1999 Text screen $0000 - $07CF 2048 - 4047 Attributes $0800 - $0FCF 8192 - 16383 Character definitions $2000 - $3FFF TEXT SCREEN You'll notice that the text area and attribute area are but 2000 bytes. (80 columns x 25 rows = 2000) There is a 1 to 1 relationship between the text area and attribute area where as the location $0000 hold the character in row 1, column 1. Location $0800 holds the attributes of row 1, column 1. Definitions of text characters follow that of the screen display codes found in appendix D of your C128 system guide rather than sctrict ASCII codes. 0 = @, 1 = A, 2 = B etc..... SCREEN ATTRIBUTES Attributes are defined by the setting of bits within the attribute byte. Bit 7 0 = character set 1 1 = character set 2 (see appendix D ) Bit 6 1 = Reverse Bit 5 1 = Underline Bit 4 1 = Blink Bit 3 1 = Red Bit 2 1 = Green Bit 1 1 = Blue Bit 0 1 = Low intensity 0 = High intensity CHARACTER DEFINITION The default character definitions take 8K (512 characters). Each char- acter is defined by 8x16 bits yet only the 8x8 bits area is used under normal use. Upon system startup these character definitions are initialized by the Kernal routine DLCHAR whose Jmp is found at $FF62. This eventually jumps to the download character routine found at $C027 and continues to $CE48. This is a great routine to look at to see how writing to the 8563 is done. You'll notice that there is still some memory not used! This memory is available for various purposes. By changing the values of registers 12 and 13 you may alter which memory is used as the start of screen text or by changing registers 20 & 21 alter the beginning of the attribute definition memory. By reconfiguring these memory locations it is possible to store more than 1 screen in 8563 memory allowing you to swap back and forth between screens. 8563 REGISTER MAP Reg# Bits Reg# Bits 00 7-0 Horizontal total 23 4-0 Character displayed-vertic 01 7-0 Horizontal Displayed 24 7 Copy/Fill 02 7-0 Horizontal Sync Position 6 Reverse Screen 03 7-4 Vertical Sync Width 5 Chr Blink Rate 3-0 Horizontal Sync Width 4-0 Vertical Smooth Scroll 04 7-0 Vertical Total 25 7 Text/Graph 05 4-0 Vertical Total Adjust 6 Attribute Enable 06 7-0 Vertical Displayed 5 Semigraphic 07 7-0 Vertical Sync Position 4 Pixel Double 08 1-0 Interlace Mode 3-0 Horizontal Smooth Scroll 09 4-0 Character Total-vertical 26 7-4 Foreground Color 10 6-5 Cursor Mode 3-0 Background Color 4-0 Cursor Start Scan line 27 7-0 Address Increment per Row 11 4-0 Cursor End Scan line 28 7-5 Character Set Address 12 7-0 Display Address start high 4 4416/4164 13 7-0 Display Address start low 29 4-0 Underline Scan line 14 7-0 Cursor Position (high) 30 7-0 Word Count (count-1) 15 7-0 Cursor Position (low) 31 7-0 CPU READ/WRITE DATA 16 7-0 Light Pen Vertical 32 7-0 Blockcopy source addr high 17 7-0 Light Pen Horizontal 33 7-0 Blockcopy source addr low 18 7-0 Update Location (high) 34 7-0 Display Enable begin 19 7-0 Update Location (low) 35 7-0 Display Enable end 20 7-0 Attribute Start Addr high 36 3-0 DRAM Refresh per scan line 21 7-0 Attribute Start Addr low 22 7-4 Character total-horizontal 3-0 Character displayed-horiz 8563 Memory Write This routine is meant to be an example of how to write(poke) a byte into 8563 memory. I have used it in various programs and can be called from basic or from another machine language routine. The following registers need to be set; .A <- the value to write or poke .X <- memory location high .Y <- memory location low In basic you can use the Basic 7.0 SYS command to past the values of the .A, .X & .Y registers. I have placed it in locations $2000+. To reserve this area your basic program should begin as such: 10 GRAPHIC1:GRAPHIC0:FAST:GRAPHIC5 This will reserve space normally used by 40 column Hi-res graphics. 02000 PHA ;push .a -> stack 02001 TYA ; (y) -> .a 02002 PHA -> stack 02003 TXA ; (x) -> .a 02004 PHA -> stack 02005 LXA #$12 ;set R18 02007 PLA ;pop a. (x) 02008 JSR $2013 ;write to 8563 0200B INX ;set R19 0200C PLA ;pop a. (y) 0200D JSR $2013 02010 PLA ;pop a. (a) 02011 LDX #$1F ;set R31 02013 STX $D600 ;store 8563 reg # 02016 BIT $D600 ;wait till 02019 BPL $2016 ; status bit high 0201B STA $D601 ;store new value 0201E RTS ; in reg. The subroutine at $2013 is actually executed 3 times and uses the values of the A and X registers. Reg .X contains the 8563 register you wish to write to. Reg .A contains the value to write. $2013 You place the 8563 register number in location $D600. $2016 Next you wait till the 8563 $2019 chip clears the status bit (7). $201B At this time $D601 will logically BE that register. You can at this time read the value contained in $D601 or write a new value there as we have done here. In the above routine we actually write to 3 different registers in the 8563. Since we want to write to memory the first thing we must do is to set the Update Register(18 & 19) to contain the address we want. It must be done in order! 2005-2008 Sets the register 18 to the value passed in the X reg. 200B-200D Sets register 19 to the value passed in the Y reg. 2011- Sets register 31 and passes to it the value passed in .A As you'll note above, in the 8563 register map, R31 is the CPU Read/Write register and is used for data I/O between $D601 and 8563 memory. R18 and R19 are used as pointers to the memory location which is accessed. ======================================= I hope this helps clear some of the mysteries of the famed C128 80 column chip. More than anything it should open the door to new and exciting questions. If you have any questions or discover more about this chip contact me in the Commodore Information Network. Bill Pytlovany QLink: Bill P1 / PlayNET: Bill P1 / GEnie: BillP1 / DELPHI: P1 / CIS: 75506,110 C-128 SYS/POKE/ESCAPE COMMANDS COMMAND FUNCTION/ACTION ----------------------------------------------------------------------------- SYS 65520,R,C,0 SET/READ CURSOR POSITION (PREFACE SYS BY READ/SET) SYS 65408 KERNAL ID BYTE (PEEK(65408)) SYS 65375 TOGGLE BETWEEN 40 & 80 COLUMN SCREEN SYS 65366 SOFTWARE COLD RESET SYS 65363 AUTO-BOOT DISK SYS 65357 GO 64 WITH ARE YOU SURE MESSAGE SYS 65354,A CLOSE ALL FILES OF DEVICE IN 'A' SYS 65341 MACHINE RESET SYS 57416 GO 64 WITHOUT ARE YOU SURE MESSAGE SYS 54784 VDC VERSION (PEEK(54784)AND7) SYS 52689 READS VDC REGISTER SYS 52684 WRITES TO VDC REGISTER (VALUE 'A' IS WRITTEN TO X) SYS 52639 TURNS CURSOR OFF SYS 52591 TURNS CURSOR ON SYS 52040 80 COLUMN SCREEN NORMAL SYS 52031 INVERT 80 COLUMN SCREEN SYS 51966 ENABLE UNDERLINE CURSOR SYS 51954 ENABLE BLOCK CURSOR SYS 51900 SCROLL UP SYS 51871 CLEARS FROM CURSOR TO SCREEN END SYS 51851 CLEARS FROM START OF LINE TO CURSOR SYS 51830 CLEARS FROM CURSOR TO LINE END SYS 51794 CLEARS CURRENT LINE SYS 51748 CLEARS ALL WINDOWS SYS 51739 SET WINDOW SYS51739,TOPROW,TOPCOL,BOTROW,BOTCOL SYS 51602 GENERATES TONE ALWAYS SYS 51598 SOUNDS BELL IF SHIFT/C= NOT DISABLED SYS 51372 ENABLE SHIFT/C= SWITCH SYS 51366 DISABLE SHIFT/C= SWITCH SYS 51346 SWITCH TO UPPER CASE SYS 51328 SWITCH TO LOWER CASE SYS 51317 CURSOR LEFT IN WINDOW SYS 51303 CURSOR UP IN WINDOW SYS 51290 CURSOR DOWN IN WINDOW SYS 51284 CURSOR RIGHT IN WINDOW SYS 51069 CANCELS QUOTE & REVERSE MODE SYS 50341 CLEARS LINE NUMBER IN X REGISTER (SYS50341,,X<0-12>) SYS 49488 BASIC'S HOME CURSOR SYS 49482 HOME WINDOW CURSOR SYS 49474 BASIC'S CLR/HOME CURSOR SYS 49164,CHAR PRINTS A CHARACTER (ASCII) I.E. 49164, SYS 49155,A,B PRINTS A CHARACTER TO SCREEN SYS49155,CHAR,COLOR SYS 49152 KERNALS WARM START SYS 44953 RUNS THE BASIC PROGRAM IN MEMORY SYS 41977 PRINTS "ARE YOU SURE" MESSAGE SYS 32800,123,45,6 COMMODORE CREDITS - MOST INTERESTING OF THEM ALL SYS 19767 ENTRY - BASICS READY MODE SYS 16795 PRINT POWER UP MESSAGE SYS 16387 BASIC'S WARM RESET SYS 16384 BASIC'S COLD RESET POKE 808,50 DISABLE SAVE POKE 808,28 ENABLE SAVE POKE 808,112 DISABLE RUN/STOP POKE 808,110 ENABLE RUN/STOP POKE 808,100 DISABLE RUN/STOP POKE 792,98 DISABLE RESTORE POKE 792,64 ENABLE RESTORE POKE 792,125 DISABLE RESTORE POKE 775,81 ENABLE LIST POKE 775,139 DISABLE LIST POKE 774,38:775,139 LIST LINE NUMBERS ONLY POKE 774,61:775,255 WARM START ON LIST POKE 65341 COLD RESET POKE 4140,0 MOVES SHIFT RUN/STOP TO HELP KEY POKE 2599,1 NORMAL CURSOR 40 COLUMN POKE 2599,0 BLINK CURSOR 40 COLUMN POKE 2593,1 WAITS FOR KEYPRESS POKE 2592,10 ENABLE KEYBOARD POKE 2592,0 DISABLE KEYBOARD POKE 249,128 BEEP OFF POKE 249,0 BEEP NORMAL POKE 248,64 UNLINK SCREEN LINES POKE 248,128 SCROLLING OFF POKE 248,0 SCROLLING NORMAL POKE 24,37 LIST WITHOUT LINE NUMBERS POKE 24,27 LIST WITH LINE NUMBERS POKE 208,0 CLEAR KEYBOARD INPUT BUFFER BEFORE INPUT ESC Z CLEAR ALL TAB STOPS ESC Y SETS DEFAULT TAB STOPS ESC X SWITCHES 40 TO 80 COLUMN AND 80 TO 40 COLUMN ESC W SCROLLS SCREEN DOWN ONE LINE ESC V SCROLLS SCREEN UP ONE LINE ESC U SETS UNDERLINE CURSOR ESC T SETS TOP LEFT CORNER OF WINDOW ESC S SETS BLOCK CURSOR (80 COLUMN) ESC R REVERSES 80 COLUMN SCREEN ESC Q ERASES TO END OF LOGICAL LINE ESC P ERASES TO START OF LOGICAL LINES ESC O CANCELS QUOTE MODE (ESC-ESC ALSO) ESC N SETS NORMAL 80 COLUMN SCREEN ESC M DISABLES SCREEN SCROLLING ESC L ENABLES SCREEN SCROLLING ESC K MOVES CURSOR TO END OF LOGICAL LINE ESC J MOVES CURSOR TO START OF LOGICAL LINE ESC I INSERTS A BLANK SCREEN LINE ESC H DISABLES BELL TONE FOR CHR$(7) ESC G ENABLES BELL TONE FOR CHR$(7) ESC F SETS BLINKING CURSOR MODE ESC E SETS NONBLINKING CURSOR MODE ESC D DELETES AN ENTIRE LOGICAL LINE ESC C CANCELS AUTO INSERT MODE ESC B SETS BOTTOM RIGHT CORNER OF WINDOW ESC A ENTERS AUTO INSET MODE ESC @ CLEARS TO END OF SCREEN REAL TIME CLOCK FOR THE CBM 128 RUNNING GEOS V1.2 OR V1.3 BY TIME G. CORCORAN TIMC4 ON Q-LINK DESCRIPTION The RTC is a fully self contained clock/calendar for the CBM machine. It offer permanent time and date and is accurate to +/- 1Min. a month at constant room temperature. It copes with leap years, months less than 31 days etc. Battery life is better than 28 years and there is a second backup battery in case of premature failure of the first. Power fail (like when you turn off your monitor for the night) is automatically detected. The RTC comes with software to support it under the GEOS operating system. The source of this code is included and the machine code to address the RTC may be examined and even used outside of GEOS to access the RTC from native 64/128 machine code. The RTC takes up no memory addressed in the system memory map, the selection is done using a 64-bit serial bit stream that has very little chance of occuring by accident. The manufacture reckons the odds are 1 in 10^19. I chose to mount the RTC internal to my 128. Originally, I designed it to plug into joystick port #2, but after a month or so of operation (and staring at the circuit sticking out of my otherwise sleek machine) I opened up the case and moved it inside. I describe both techniques, so choose whichever you prefer. If you have qualms about opening your machine then stick with the external version. The joystick port is still usable (provided that you provide the pass thru.) and construction is easy in either case. By the way, my RTC is accurate to 50 secs. per month. CONSTRUCTION The RTC has been built and tested in both formats, internal and external mounting. The external version will work on either a 64 or 128 machine. The internal version should also work in either case but only the 128 version is described because that's all I have to test it on. The entire RTC is con- tained within one module, a 28 pin IC socket. The device was originally intended for use in a PC or other machine where board space was a premium and it was designed to replace a socket for a 28 pin ROM part. It is not used in that fashion in the 128 though. I mounted it in an open space on the mother- board, upside down, 'dead-bug-style'. The I glued it in position (use a non- conductive and removable glue, just in case). For the external version the other components needed are a circuit board and some 9-pin D connectors for the joystick port. See parts list and detailed assembly instructions later. OPERATION 28 VCC The software supplied, supports the 7-----VCC ********** RTC from GEOS. The two applications * * --- allow reading and writing the RTC 1----------DATA------11* *1 RST device. The read application is an -- * * auto-execute file under V1.3. It 2----------WE--------27* * will automatically update the time -- * DALLAS * and date when GEOS boots, PROVIDED 3----------OE--------22* * that you put it on your boot disk. -- * DS1216 * The write routine copies the current 4----------CE--------20* * time and date to the RTC from GEOS. * * Setting of the time and date must be 8-----GND * * performed with the preference mana- ********** ger as normal (but of course once JOYSTICK 14 you set the RTC, you'll never have PORT #2 GROUND to bother again). I included the source to my applications so you can Figure 1. RTC for C64/128 machines. learn from them how to program the RTC should you wish to. The RTC is programmed through CIA #1. The lines I used to interface to the RTC are also used for the joystick of course as well as by the keyboard scanning routine. The RTC does not interfere with any of these activities however. The remainder of this document describes the two assembly procedures in de- tail. The parts list is also included. Construction should take a few hours with good soldering skills and careful work. Whil I have taken great pains to ensure the accuracy and safety of my design, I'm afraid I cannot be held responsible for any problems it may cause with your machine. I have built several prototypes and had no problems whatsoever and I am always willing to help if you run into difficulty. ASSEMBLY INSTRUCTIONS Choose your work surface carefully. Remember that both the RTC module AND the 128 can be harmed by static electricity discharges. I grounded the chasis of the 128 to a water faucet. Then at regular intervals during assem- bly ground yourself to the chassis to discharge any potential your clothing, etc, may generate. Ideally, purchase a grounding wrist strap at Radio Shack and follow the enclosed instructions. Use a low-power soldering iron (15-25 watt) and good quality multi-core solder. You will also need a pair of fine nose pliers, a philips head screwdriver and perhaps a solder sucker tool or desoldering braid. Light guage solid core hookup wire is ideal for the power/ground connections, a few inches of 4-conductor wire is best for the hookups to the CIA (iternal version only). INTERNAL VERSION Since this is the more complex version, I will describe it first. While my techique for mounting the module may not be too professional, I have found it to be solid and reliable. First, disconnect everything from the 128. This may be obvious but I should say it anyway. Remove the upper portion of the 128 case by removing the screws from the base of the machine. Then carefully pry the case open (finger pressure is all it takes) and unplug the keyboard and LED harnesses (remember the orientation of the plugs). The grounding strap is attached to the lower cabinet by means of a screw, which can be removed. Next remove the screws retaining the metal shroud over the motherboard. The screen is soldered to the board at one point, carefully melt this. The screen is also held in place by twisted tongues of metal from the lower half of the screen, simply straighten these gently with pliers. The screen should remove easily now. The next step is to locate the spot where you wish to mount the module. Locate the power socket in the corner of the motherboard. Nearby there is an open area of board (next to the large capacitors). I chose to glue the module upside down here, like a dead bug with it's legs in the air. The back of the module (socket side) should first be insulated with a layer of tape to avoid any possibility of a short). I used short single core wire to connect the power and ground. Don't get confused about your pin numbers now, because the chip is upside down. Mark pins 1 and 28 so you get the wiring right. I used the negative (-) lead of the 100uF capacitor C107 near the power con- nector as a ground point to connect to pin 14 of the RTC. Then I used pin 1 (marked by a square on the silk screen outline) of the resistor pack RP8 as +5v. This resistor pack is easy to find, sitting out in a clear area of the motherboard. Be VERY carefule to get these points right and to wire correct- ly, the damage you can do here is horrific so be carefule. I then wired the four signal pins of the module (11,20,22,27) to the back of the Joystick socket. The socket on my 128 has exposed pins for connector pins 1 thru 5 on the joystick ports. Carefully solder four wires to these exposed pins, and the other end of the wires to the corresponding pins of the module. If your 128 has covered pins you must find an alternate location nearby. Now double check your work. Lastly, place several layers of insulating tape on the inside surface of the metal screen, directly over the RTC module. This is to prevent shorting out the module with the screen. Now would be a good time to check for shorts in your wiring too. Be absolutely certain that you haven't confused the pinout of the module because it is upside down on the motherboard. Check for solder blobs on the joystick connector and the module itself. The last thing to do before reassembling the 128 is to reset the RTC module. This is necessary since the factory stops the clock and places the circuit in a power down mode to lower battery consumption during storage. The reset pin is pin 1 of the module. Simply short this pin briefly to ground (pin 14 of the module) and the circuit powers up and self resets. The software can take it from here. Reassemble the screen over the motherboard and don't forget the small solder bridge you undid earlier. This is important to ground the whole assembly. Carefully reconnect the ground strap between keyboard and motherboard, and attach the keyboard and LED connectors. Reassemble the two case halves and screw the retaining screws in place. If you are sure that nothing's amiss, hook up the 128 and prepare to try out your handiwork. Skip to the testing section of this document. EXTERNAL VERSION The external version of the RTC can be built in two ways, with the provision to allow normal use of joystick port #2, or not. To support normal use of the port, you must pass the 9 signals of the connector thru to a socket for a joystick, mouse or other I/O device to use. In order to achieve this pass- thru with the least trouble, you need to use a male and a female 9-pin con- nector. The GEOPAINT file RTC.DIAG shows how I mounted the module and the two D-connectors. I took a Radio Shack circuit board (Part #276-248), snapped it in half and cut one half to the desired dimensions. These dimen- sions are 7 holes by 15 holes, or about 3/4" by 1 5/8". The cutting is best done with a fine-bladed hacksaw. Next, I carefully assembled the two D-connectors and the board. I found that the board fits snugly between the two rows of solder tails on the connectors. The 5-pin row of solder tails should be on the copper side of the board and the tails should align as closely as possible to the solder pads on the board. The alignment isn't perfect so be careful to avoid a short between two ajacent solder tails. Carefully solder the 5 tails to their respective pads. This will keep the connectors in place during the rest of the assem- bly. Now, it is necessary to cut straight lengths of wire to run between the solder tails of one connector to the other, pin 1 to pin 1, 2 to 2... 9 to 9, etc. These wires provide the pass thru of the joystick port for the second input device. If you have elected to dedicate joystick port #2 to the RTC then of course you don't need these wires and can skip to the next paragraph. The wires should be exactly the length needed to run straight between the connectors. This serves two purposes, one to keep the wire straight, since the RTC module fits over the row of 4 wires on the non-copper side of the board, and two, to provide more mechanical strength to the whole assembly. You can solder these wires in place now. Remember though, that the wires to connect the module to the joystick lines must also be soldered to one end of these wires. If you're tidy, the soldering can be done now, and the second wire inserted when you are ready (see later). Now you should have a fully functional joystick port extender. Check your solder for shorts and blobs. If you're happy then proceed, otherwise rework as necessary but remember that the connectors are housed in plastic. Too much soldering heat and this plastic can melt, destroying your handiwork. Next, solder wires to pins 7 and 8 (the middle two solder tails of 4) on the connectors. These pins are power and ground respectively. Since you are soldering these wires on the non-copper side of the board you will need to be neat and not obstruct the mounting of the RTC module later. These wires should be soldered, one to each connector. This is because the power and ground pins are at opposite ends of the module. Figure out where the power pin (#28) will be inserted and run the free end of the wire soldered to solder tail 7 through that hole. Similarly for the ground pin/hole (#14). What this means is that the RTC module power and ground pins will be sharing their board holes with the power and ground wires, thus allowing a single soldering job to connect power and ground to the module. Taking care to handle the pins as little as possible, and grounding yourself to avoid static damage, take the RTC module and gently mount it on the board, the row of four wires between the connectors on the non-copper side of the board should fit neatly beneath the module, and the power and ground pins of the module (28 & 14) should be in the same holes as the wires you soldered to pins 7 and 8. Now you are ready to wire the four interface pins of the RTC module to solder tails 1 thru 4. All of these wires are on the solder/copper side of the board. Carefully measure the length of wire you need, solder it to the con- nector pin and poke the free end of the wire through the hole corresponding to the RTC module pin you need to connect to. Now carefully apply solder to this junction. Repeat for the three other wires and carefully recheck your work. A short could damage the port on your computer so get it right. If you have come this far and are convinced your handiwork is good, then there is only one more step, resetting the RTC module. This is accomplished by briefly shorting pin 1 (RESET) to pin 14 (GROUND) on the module. You may need to do this after plugging the RTC into the joystick port #2 on your machine and powering up. It seems that som modules will reset while in the battery powered mode, others only when fully powered up by the 5V supply from your machine. In either case be careful and don't short anything else out, just pins 1 and 14. I can't over-stress the importance of double and triple checking your work. Time taken to locate shorts and open joints now can save many hours (and $$$) later. Using a meter, test for shorts bewteen the pins of the connectors, in particular there should not be a short (just a low impedence) between power and ground (solder tails 7 & 8). If you pass this test also, then you can proceed to try out the S/W. TESTING THE RTC Instert the RTC into joystick port #2 and power up your machine. If you fail to get the familiar screen, immediately turn off the power and remove the RTC. Otherwise boot GEOS. The S/W comes as two applications, READ#2 and WRITE#2. These allow you to copy the current time/date info from the RTC to GEOS and from GEOS to the RTC. If you are running V1.3 the READ#2 applica- tion is an auto-execute file and performs the time/date setting on boot up. Otherwise, do it manually as part of your start up process. You will need to keep READ#2 on your boot disk(s) but WRITE#2 will only be needed once (I hope). Go to the preference manager and set the current time and date. Exit the preference manager and double click on the WRITE#2 icon. The screen will blank for a few seconds and then desktop will reload. Hopefully you have now set the current time/date from GEOS into the RTC. Let's see! Now double click on READ#2. Again, a few seconds of blank screen and then desktop returns. Now reload preference manager and check the time. Is it still current? If so then the RTC is probably working but just to be sure, change the time/date to some other value and exit. Rerun READ#2 and then check the time/date with preference manager. If it's correct, CONGRADULA- TIONS! YOU DID IT! Otherwise, power down and carefully check your work again. The circuit is simple so take your time and locate what is probably a simple error. If all else fails, contact Mystic Jim or TIMC4 on QLink. PARTS LIST FOR RTC 1 X DALLAS SEMICONDUCTOR DS1216 "SMARTWATCH" SINGLE CONDUCTOR HOOKUP WIRE (LIGHT GUAGE) 4 CONDUCTOR FLEXIBLE HOOKUP WIRE (INT) 1 X RADIO SHACK CIRCUIT BOARD (P/M 276-148) (EXT) 1 X RADIO SHACK 9-PIN D CONNECTOR, MALE (276-1537) (EXT) 1 X RADIO SHACK 9-PIN D CONNECTOR, FEMALE (276-1538) (EXT) (EXT) MEANS EXTERNAL VERSION ONLY - (INT) MEANS INTERNAL VERSION ONLY ........9-pin D connectors........ . . ! 4 Pass-Thru wires . RTC Module.... . ! . . . . ! . .! ------------------.--------- !. ! ! ------------.--------------- ! -!-! ---------------.------ !-!- ! -!-! . !-!- ! ! ! ! . ! ! ! ! ! ! ! >----------.-------------< ! ! ! ! ! ! DS1216 . ! ! ! ! ! ! ! >----------.-------------< ! ! ! ! ! ! ! ! ! ! ! ! ! >----------.-------------< ! ! ! ! ! ! ! ! ! ! ! ! ! >----------.-------------< ! ! -!-! ---------------------- !-!- ! -!-! !-!- ! ---------------------------- ! ! ! ---------------------------- ! ! RTC MODULE MOUNTED ON ! CIRCUIT BOARD BEFORE CIRCUIT BOARD ! MODULE WAS INSTALLED ! 1!2 --------------------------------------!-------------------------------------- 3!4 5 PASS-THRU WIRES ! -- -- -- . ! 15 CE OE WE 28 ! -------------.-------------- ! ! ! ----------------------------- ! -!-! . !-!- ! -!- ! ! ! ! ! . ! . ! ! ! ! . ! -!- ! ! >-----------.------------< ! ! ! ! ! > . . . < ! ! ! ! >-----------.------------< ! ! ! ! ! ............ . . < ! ! ! ! >-----------.------------< ! ! ! ! ! ................ . < ! ! ! ! >-----------.------------< ! ! ! ! ! > . < ! ! ! ! >-----------.------------< ! ! ! ! ! ........ .... ! ! -!-! !-!- ! -!- ! ! ! . ! ! ! ! ! ! ! ! ! ! -!- ! ---------------------------- ! ! ! ---------------------------- ! ! 14 DATA 1 ! SOLDER/COPPER SIDE ! SOLDER/COPPER SIDE OF THE RTC, OF THE RTC CIRCUIT ! SHOWING THE 4 INTERFACE WIRES BOARD ! SOLDERED TO THE PINS OF THE RTC ! MODULE. (NOTE: FOR CLARITY THE 5 ! PASS-THRU WIRES ARE NOT SHOWN.) COMMODORE 128 VIDEO RAM EXPANSION by Larry Moonan The C128 computer comes equipped with 128K of RAM to be used by the computer. When the computer is running in the C64 emulation, 40 column C128 mode and the 40 column CP/M mode an area of this 128k RAM is being used by the VIC II chip to store the text and/or graphics being displayed. This takes up any- where from 1k to 10k of this 128k RAM, depending on whether any graphics are being used and if it is color graphics. When the computer is running in either the CP/M or C128 80 column mode, you are no longer using any of the computer's 128k of RAM for screen data. This is because the VIC II chip cannot handle 80 columns, so the 80 column output is being handled by another chip called the 8563 video chip. This is a chip designed by Commodore, spe- cifically for handling 80-column output. The 8563 video chip has many advan- tages over the VIC-II chip, besides being able to handle 80 columns it has both text and graphics modes. In the text mode you can simultaneously dis- play both the uppercase/graphics and uppercase/lowercase character sets on the screen. The characters can also be underlined, reversed, and/or blink- ing! The graphics mode of the 8563 is not directly supported in the BASIC 7.0 supplied with the computer, but it can be accessed using any of the many graphics expander products such as "Ultra HiRes Graphics" or "Basic 8" by Lou Wallace, or "Graphic Expander" by Horasoft. The graphics mode of the 8563 gives a resolution of 640x200 pixels on screen. This is the same as an unenhanced IBM PC or a 2 color noninterlaced medium resolution screen on the Amiga. Now, as I told you earlier, the 80 column screen data doesn't occupy the same area in RAM as the 40 column screen since the VIC II chip does not handle the 80 column screen. If you look at the memory map of a C128 you'll also notice that there is not area of memory within the 128k of the computer's memory put aside for the 8563 chip to use as screen memory. This is because the 8563 chip is designed to be able to directly address a RAM memory of its own. Looking at the schematics of a C128 you will see that the 8563 video chip is connected to a separate 16k of RAM, which is completely independent of the 128k of RAM used by the computer. It is this 16k or RAM which stores the text/graphics screen data for the 80 column screen. So in a sense you don't have 128k of RAM in a C128, but rather you have 128k + 16k = 144k or RAM present, only 16k of this is never seen by the computer directly. The C128 talks to the 8563 chip through the memory addresses 54784 ($D600) and 54785 ($D601) of bank 15 in the C128 memory map. So through only two bytes of the 128k RAM you can access the 8563 video chip and/or the additional 16k or RAM attached to it. Besides being used for the 80 column screen, this RAM can also be used for other purposes, as long as you are only running in 40 column modes of the C128, such as the RAM disk project shown in the July 1986 Transactor magazine (Vol. 7, Issue 01). You can find out more about the 8563 chip and programming for it in the C128 Internals book by Abacus, the Commodore 128 Programmer's Reference Guide by Bantam, and from information posted on Q-Link by Bill Pytlovany. When Commodore designed the 8563 chip, # # # # # # ! ! they gave it the ability to address up # # # # # # ----! !------ to 64k of RAM directly, even though ! they only supply it with 16k. The RAM ! used by the 8563 is in two standard ! 4416 RAMs, each handling 4 bits by 16k ! TV MODULATOR of memory. Together they give us 4 ! bits X 2 = 8 bits = 1 byte by 16k of ! memory for the screen data. Luckily ! for us C128 owners there is a direct -------------- pin for pin chip replacement for the ------------------------------------ 4416s called the 4464 (there are many ! -####- ! equivalent RAMs), which handles 4 bits ! **** **** ! by 64k of memory. The chips cost about ! * * -####- ! $3-4 each. This means for only $8 you ! * * ***** ******* ! can QUADRUPLE the RAM available for the ! * * * 7 * * * ! 8563 video chip. This extra RAM can be ! * * * 4 * * * ! used by the 8563 to increase the number ! * * * L * # * * ! of text screens, character sets, char- ! * * # * S * # * * ! acters displayed, and increase the num- ! * * # * 2 * # ******* ! ber of colors available in graphics ! * 8 * # * 4 * ! mode. This extra memory allows you to ! * 5 * # * 4 * #### ! display all 16 colors in graphics mode. ! * 6 * ** ** -###- ! This beats any unenhanced IBM PC and ! * 3 * ! directly compares with the maximum num- ! * * ***** ***** ! ber of colors available on the medium ! * * * * * * ! resolution (640x200) screen of the ! * * * 4 * * 4 * ! Amiga! It is also worth noting that ! * * * 4 * * 4 * ! "Basic 8" by Lou Wallace supports this ! * * * 1 * * 1 * ! increase in screen RAM. I've also been ! * * * 6 * * 6 * ! told that the new C128D will come with ! * * * * * * ! this 64k RAM as standard equipment. ! ********* ** ** ** ** ! Why Commodore didn't do this initially ! ##### ##### ##### ! with the C128 is puzzling. ------------------------------------ Replacement of the 4416 RAMs with 4464's is not very difficult if you are handy with a soldering iron and you are careful you don't fry anything. If you don't feel confident with doing the modification, please bring it to someone who is more technically proficient such as the nearest Commodore service center. Sure this will cost you a little more, since there will be a labor charge, but it's well worth the piece of mind it brings you. To replace the 4416s with 4464s you must first open up the C128 computer. This involves removing the screws from the bottom of the case and discon- necting the keyboard and LED cables (you should label them with how they were connected). After removing the keyboard/top of the computer you will see a large piece of metal which shields the computer from RF interference. This is removed by carefully bending the small metal tabs along the sides of the shield back and desoldering the ground point (it's near the joystick ports). Under the shield you will now see guts of the computer. Looking to the back of the computer near the TV modulator output jack you will see two silver boxes. One of them is the TV modulator itself (the TV output jack is directly connected to it). The next box is a little closer to the center of the computer and this houses the VIC II and 8563 chips. You will need to remove the screw from the top of the box and carefully pull the top off. Inside you will see a relatively large chip on your left. This is the 8563 chip. Just to the lower right of this chip you will find the 4416 RAMs (the relatively large chip on your right, labelled 8564 is the VIC II chip.) At this point you will also need to remove all the screws from the motherboard to remove the plastic bottom of the computer so that you can desolder the 4416s, since Commodore uses a double sided PCB for the motherboard. Again, YOU DON'T WANT TO DAMAGE THE MOTHERBOARD IN ANY WAY, SO BE CAREFUL WITH THE HEAT OF THE SOLDERING IRON!!! It might be a good idea to take a pair of right angle wire cutters and cut the 4416s out first, then you can easily desolder each of the remaining pins while pulling on it with long nose pliers. I would STRONGLY suggest solder- ing some low profile sockets in place at this point, so you will be able to swap RAMs easier in the future and avoid damaging the 4464s from the heat of soldering (the 4464s are CMOS circuits, which are easy to damage by heat or static electricity, so HANDLE THEM CAREFULLY!) Now, plug the 4464s into these sockets and you're all set. Reverse the dissassembly process, (re- member to resolder your ground point after installing the RF shield), and enjoy your newly expanded C128 computer!