A következő címkéjű bejegyzések mutatása: commodore. Összes bejegyzés megjelenítése
A következő címkéjű bejegyzések mutatása: commodore. Összes bejegyzés megjelenítése

2015. február 16.

Amiga 500+ ébresztése kómából, 2.

Régi és új foglalat, a lábkiosztással
Miután a gyanú a FAT AGNUS chip foglalatára terelődött, beszereztem egy ugyanolyan 84 érintkezős THT PLCC fogalaltot. Az ugyan olyan, azért fenntartásokkal kezelendő, mivel más a szine... de csak ilyen volt.

Amint megvolt a kiváltó alkatrész, elkezdtem szépen körbenyalni a lábakat ónszívó zsinórral. Sajnos rá kellett eszmélnem, hogy ha a lábak is a lyukakban vannak, annyira sohasem fogja az ónt felitatni az a drót, hogy a foglalatot csak simán ki tudjam emelni.
Felnégyelt régi foglalat
Miután ez egy olyan fogalalt, hogy a lábai a négyzet mindegyik oldalán, két sorban állnak, esélyem sem volt használni a remek, új szerzemény, csipesz IC kiforrasztópákámat, lévén az egyszerre két sor lábat tud melegíteni. Mindemellett, közben a forrasztóállomásomhoz tartozó páka, kerámia fűtőhegye is beadta a kulcsot. Ebből rendeltem újat, de az egy hét míg megérkezik, ígyhát elővettem egy régi, kicsit viseltes weller stílusú pákát, és azzal folytattam a küszködést.

Foglalat eltávolítva, az lap sértetlen
Sajnos nem sikerült megfelelően egyszerre mind a négy oldal, két-két lábsorát felmelegíteni, hogy a foglalatot eltávolíthassam, így úgy döntöttem, redukálom a problémát dupla lábsorokra. Hogy hogyan? Elővettem a miniatűr fúrógépem, és befogtam egy miniatűr flex lapot a fúróhegy helyére, és a foglalatot a nyákon felnégyeltem óvatosan, ügyelve rá, nehogy alatta az áramkörökbe belevágjak. Így már a csipesz pákával két-két sort egyszerre melegítve sikerült a toktól megszabadulni, majd megtisztítani a helyét a régi, hagyományos pákámmal, ónszívót használva.

Foglalat és chip a helyén, tisztán
Az új foglalat a tisztítás után pikk-pakk a helyére került. Sajnos látszik rajta, a színe miatt is, hogy pótolt darab, viszont ez legalább tökéletesen fog érintkezni. A FAT AGNUS chip lábait pedig 1000-es finomságú csiszolópapírral megdörzsölgettem, biztos ami biztos, ha van rajta korrózió az lejöjjön.

2.04-es Kickstart boot képernyő
Összeszereltem a gépet (mínusz csavarok), bedugtam az A520-as TV modulátort, összekötöttem a kompozit kimenetét a számítógéppel, azon belőttem a TV kártyát Composit PAL-B bemenet megjelenítésére, és az Amiga 500 plus hölgy kinyitotta szemét Georgina napján: "kérem a boot lemezt!" kiáltotta fel, hosszú kóma után, először. Most már "csak" egy Workbench 2.04, 2.05 vagy 2.1 lemez szettet kell szereznem, meg valami játékot/demót, hogy megbizonyosodjak a gép többi részének működéséről. Alkalom adtán, az aksit is pótolni kell, de ezúttal NiMH fajtából, és az alaplaptól messze elvezetve. Isten hozott Gigi az életben, ismét!

2015. február 12.

Amiga 500+ ébresztése kómából, 1.

Amint ébredezni kezdett, először megpróbált felállni, de a power LED villogását követően folyton visszazuhant. Néhány kísérlettel a sötétszürke, világosszürke, fehér képernyőig jutott, de itt mindig megtorpant. Aztán egyszercsak megszólalt: "Doktor úr! Nem emlékszem!" - tette mindezt egy zöld képernyővel, és a power LED villogtatásával. Majd ismét, és ismét. Néha majdnem sikerült neki, akkor sárga képernyővel roskadt magába, elveszítve egyensúlyát, majd ismét jöttek a zöld képernyők! De most már legalább beszél hozzám! Ez nem mindig volt így!

Ez a szegény, hajléktalan Amiga 500 plus hölgyemény, egy kedd esti időpontban toppant be hozzám. Csapzott volt, koszos, poros. Látszott rajta, hogy valaki már régóta a pince legalján dugdossa. A tápegysége folyton be volt kapcsolva, a gomb állására fittyet hányva, a floppy meghajtóból önteni lehetett a homokot. Az első mozdulattal ment a mosásba... csak amolyan immel-ámmal, vegyszerek nélkül, hogy egyáltalán a betegosztályra fel lehessen venni. Eztán jött a vizsgálódás: tápegység kis igazítás után rendben (összeértek a kapcsoló kábelei belül), megfelelőnél kicsit ugyan magasabb feszültségeket ad, de terheléssel határértékeken belüli.

Miután ez egy Amiga 500 plus, egy vele született rendellenességget is azonnal orvosolni kell, mielőtt az általa okozott fekély megeszi a belső szerveit: ezeket a gépeket, a hagyományos 500-assal ellentétben, beépített, akkumulátoros órával gyártották. És ez az akkumulátor vajon miből van? Hát persze hogy NiCd! Ez a hosszú, kisütött állásban elkezd szétfolyni, és mindent szétmar magakörül. Ezt azonnal egy csípőfogóval ki is operáltam. Szemrevételezéssel körbevizslattam, a felszíni korrózión kívül nem tűnt nagyon elnyűttnek.

74LS244-ek kivágva, korrózió hatása
Bekapcsolva csak a nagy, fekete, üres tekintettel találkoztam. Az A520 TV modulátoron sem jött ki semmi, de a gépbe épített fekete-fehér kompozit csatlakozón sem (amire az van írva, hogy "Mono", mint monochrome, csak hogy megtévessze az embereket). De a power LED a félhomályról teljes erősségűre kapcsolt, és a billyentyűzet is jó, mert a caps-lock nem villog (magától), persze ha kapcsolgatom, akkor igen. Diagnózis: a páciens nem halott, hanem kómában van. Mivel ez egy csöves (érsd: ajándékba kaptam, és amúgy is nagyon olcsó volt), elhatároztam hogy a rendes diagnózis helyett, Dr House-t játszom.

Ennyi "szemét" keletkezett
Akcióterv: kicserélem a korrodált IC-ket, a NiCd akkuhoz legközelebb eső (GARY) IC foglalatát, meg azt a néhány ellenállást, és kondenzátort, amit megviselt még a sav. Leellenőrzöm a nyomtatott áramkör vezetékeit, és kicserélem az összes elektrolit kondenzátort. Ez utóbbi olyan kondenzátor, ami folyadékot tartalmaz, ezek szintén szeretnek az évek alatt tönkremenni, főleg hogyha eleve olcsók voltak, mint amivel a Commodore cég próbálta a költségeket csökkenteni. Így is lett. Megrendeltem az alkatrészeket. Csak: 48 lábú IC foglalatból csak precíziós volt, olyan, amilyen az alaplapon csak 24 lábú (abból is rendeltem párat, elvégre egymás mellé rakva kettőt, pont 48 lábúnak felel meg), illetve tengely irányú MLC kondenzátorokat már nem gyártanak, így azok majd jobban ki fognak állni a lapból.

Alaplap lepucolva
Alkatrészek egy pénteki napon meg is érkeztek, én meg nekiálltam kiszedegetni a berozsdált elemeket a NYÁK lapról. Az IC-k lábait egyszerűen levágtam egy sniccerrel, egyesével, majd egyesével is forrasztottam ki őket. A 48 lábú IC foglalat esetében is az volt a célravezető, hogy az érintkezőket a foglalatban elhajlítottam, majd alulról az ónt megolvasztva, felülről egy csipesszel az érintkezőt kihúzva egyesével végigmentem az összesen. Ez a mutatvány fél órámba sem telt összesen. A végén maradt egy teljesen ép 48 lábú IC foglalatom, érintkezők nélkül (ez majd később lesz érdekes). Az elektrolit kondenzátorokkal rendszerint megkínlódtam, ugyanis a forrasztó pákám nem tudta megfelelő ütemben felmelegíteni a ónt azokon a lábakon, amik valami nagyobb felületű rézvonalhoz csatlakoztak, amilyen jellemzően a földelés a kondiknál. Aztán ráeszméltem magamtól, hogy a vékony hegy hőkapacitása és hővezető képessége nem megfelelő a feladatra, és helyette a sokkal durvább hegyet kell használni. Azzal már ment minden a maga útján.

Régi IC foglalat felújítva
Amikor minden kikerült az alaplapról, ecettel passziváltam a maradék savat és korrodált felületeket. Az ecet és forrasztó gyanta maradékot pedig alkohollal szépen le lehetett mosni. Így már kontakt felületeket találtam, amin a méréseket is el tudtam végezni (a korrodált felületek nem vezetnek, azokat mindig kapargatni kell, hogy az ember szakadást vizsgálhasson). Itt azért jól jött a kispolski felújításból megismert egy-két trükk. Ami újdonságot tanultam, az az ónszívó szalag használata: hogy jól működjön, érdemes megmártogatni pákával felolvasztott folyasztó / forrasztó gyantában, utána csak rá kell nyomni a páka hegyével az ónnal teli furatra, és az szépen, magától felvándorol a szalagra. A mérések során, meglelepetésemre, az összes vezeték ép maradt, így egy átkötést sem kellett csinálnom.

Új kondik, ellenállások, felújított IC foglalat
Következett a beültetés: az első körben a 17 elektrolit kondenzátort tettem a helyére. Utána a két kivagdosott és forrasztott 74LS244-es IC-t. 3-4 óra szenvedés után, éppen elbűvölten nézegettem a művemet, amikor ráeszméltem, hogy az egyik IC-t fordítva forrasztottam be. Lehetett kiszedni, kitisztítani a furatokat megint, és beültetni egy másikat (kb 27 Ft volt, emlékeim szerint, jó ügynök volt, kár érte). Aztán a 48 lábú IC tok. Itt elgondolkodtam, ugyanis három lehetőségem volt: a 48 lábú precíziós tokot használom (teljesen máshogy néz ki, mint az eredeti), 2db 24 lábút egymás mögé ültetek be (azért látszódni fog hogy nem egy darabból van), vagy 2db 24 lábúból kiszedem a tüskéket, és berakom az egyébként teljesen ép IC tok műanyagba, amit kiforrasztottam. Végül ez utolsó megoldást választottam, és meg kell hogy mondjam, az a 10 perc, ami alatt elkészültem vele (ide értve a műanyag ecetes, majd vizes mosását és szárítását is), megérte. Teljesen újnak néz ki, és az eredeti környezetébe remekül passzol emiatt. Csak egy jó (kicsi) fogo, meg csipesz kellett hozzá.

Miután mindent szépen beültettem, a megfelelő ellenállásokat is a megfelelő helyekre, jöhetett a teszt...  ....Néha majdnem sikerült neki, akkor sárga képernyővel roskadt magába, elveszítve egyensúlyát, majd ismét jöttek a zöld képernyők! A zöld képernyő jelentése: valami gond van a memóriával (vagy az oda vezető úton). Mivel a processzortól, a FAT AGNUS-on keresztül vezet az út, hát vetettem rá egy pillantást. A képen is látszik, hogy miután kiszedtem a PLCC csippet a tokból, a tok lábai össze-vissza állnak. A korrózió ezt a tokot is elérte, és néhol meggörbítette/gyengítette az érintkezőket (lásd kép)

Köszönöm Hölgyem, hogy beszél hozzám! Most már tudom mi a következő teendőm.

2015. január 30.

1571 cleaning, and power supply repaires

I have bought already ages ago the new capacitors for the power supply of my 1571 drive, and Commodore 128. Those electrolyte capacitors tend to spill, and fail over time, that's why I decided to prevent damage, and exchange those early. Other than that, my C=128 power supply unit was buzzing loud, and wanted also to investigate that problem too.

Opening up the C128 PS, I found the small bracers on the lower case supporting the transformer broken, so the screws holding it couldn't hold on to anything. This way, the 50Hz freq made the plate on top of it to vibrate, making the annoying sound. First, I experimented with super glue, without success. The glue itself stuck to everything, besides the broke off parts of the stands. I even made the situation worse, by ripping off some of the still somewhat attached parts. However, my second choice, what all the times worked for me so far, worked: the two component epoxy plasticine.
After the curing time, I just needed to carve it to it's final shape, and ready to drive in the screws. On the picture, the two tall, black capacitors are the new ones. Measuring the old ones, I have found them capacitance wide above rating, however the new ones have lower ESR values. After putting all the things together again, and cleaning the wires as well, I have got a reasonable looking, and fully functional C128 PS.

On the 1571, last time I opened it up, I have discovered a suspicious capacitor (the blue one, having sign of excess heat exposure). It was high time to swap it for a new one. Unfortunately, these days the inline version of capacitors are not in fashion anymore, so I could get parallel legged ones with the same ratings. This made me facing a new problem: how will I plant in those new caps., with drilled holes so much stretched apart of each other? Well, fortunately, the PCB traces are wide, and runs next to the other hole as well. Only needed to do is to drill a new hole on the track, next to the other, and plant in the capacitor, lying down. I also exchanged those small ones, which 1uF 63V, and 47uF 16V, with new, surprisingly smaller ones, without problems. Assembling the PSU together again, I have noticed, that before, the mains input was plugged into the 220V line of the transformer. Since in Hungary we have 230V, I have decided to use 240V instead. Also retrofitted those two three legged regulator ICs screwed against the aluminum case, with thermo paste, to help prolong their lifetime.

Turning the PSU on, measured the voltages across different components. 5V output pin: 4.96V, perfect! 12V output pin: 11.98V, perfect! Voltage on the biggest capacitor: 32V. Since it is the puffer capacitor before the 12V regulator, and it is rated 40V, it is considered OK. The new, exchanged capacitor experienced 17.4V! Not good! Since it is rated 16V as it was before the case, with the older, blue cap. Switching the mains input to 220V (as it was the configuration before), made the story even worse, measuring 19.2V on the very same capacitor. This explains, why it showed excess heat wear. I will need to get a higher rated one, any time soon.

Since my 1571 was apart, I took the opportunity to clear the casing thoroughly. It became less yellowish, and gained back a nice grey-brown color. The only surprise I faced: the front label stating "Commodore 1571 Disk Drive" faded as well and didn't stop until it became fully white. I will need to replace it. Other than that, its almost perfect now.

2015. január 28.

How I sped up CP/M display

As I have mentioned on my earlier post, I wasn't satisfied with the speed of character display speeds in Commodore 128 CP/M. So, I have investigated the source codes on me, related to Z80 ROM, and CP/M BIOS. In the meantime, I have learned the 8080 derived Z80 mnemonic syntax (bleh, ouch, very inconsistent compared to the Z80 syntax), and begin to code... well, not really, first I needed to establish a development environment.

VICE 2.4 C=128 emulator proved to be buggy on emulating C128+1571 drive in CP/M mode, making all write attempts to disk a failure. So, I also installed VICE 2.3. I have tried to use MyZ80 as was advised for speed reasons, but failed to get a CP/M 3 version of it, so I decided to compile and test also on VICE, C128 emulator, and write the source on my laptop in Windows 8.1. To transfer single files to D71, D64 images, a DOS tool-set can be used: ctools. So, I also needed to install DosBox 0.74 to make that happen.

In VICE, running C128 I configured 3 disk drives: 8: 1571 as boot, 9: 1571 as temp/transfer, 10: 1581 to have more space for the sources and compile. The workflow was as following:
- Modify source in Notepad++
- Use ctools to copy modified source to temp.D71, under DosBox
- Boot up VICE C128, copy sources from temp.D71 to development.d81
- Compile in VICE
- Update CPM+.SYS on boot
- Reboot and test, and restore the boot.d71 on failure

But getting down to business, and modifications a made to the BIOS. Making a long story short: I have implemented a buffered, and burst output to directly to the VDC chip, leaving out the built-in ROM when needed.

Why did this speed up the display process at all? And how could I convert a char-by-char display to a buffered one? It's not that obvious as it sounds for the first time, if someone doesn't know the inner workings of the BIOS, so let's have a look at that first.

The BIOS provides only a single "chout" procedure for the BDOS, to make a single char displayed on the next cursor position. Sounds simple? Ehh, not. Since this BIOS call is redirectable, depending on the active device (a disk, printer, console, etc...), and the handling of the special chars on the console (screen), like "go to top left corner" expressed with a single car, or "go to X column and Y row", expressed by 4 chars after each other, using the proper escape sequence. The original BIOS handles those special char sequences by storing callback, continue addresses pointing to further char checks on next BIOS call. Also, the BIOS checks every time the active devices, where most of the times only the screen is active as char out device.

Making those shortcut on device checks were already introduced in '93, with the speed bios verison 6.2. I have just added a buffer, to store chars on BIOS call, and only flush to display when it is full. The "flush" procedure has the trick. It reads up all the chars stored in the buffer one after the other, and if they are normal characters meant to be displayed ordinary, it uses the feature of the VDC chip, to auto increment memory addresses where the next character is to be stored. Since most of the time the buffer contains only normal chars, it has the following consequences: 2*char-num-in-a-row+14 output instructions, compared to the contant 16 output instructions per char in the original implementation, using the BIOS. Since IO is potentially slow to communicate with the VDC chip, it is a big gain, having 92 outs for 40 char string, instead of the 640 outs in the old implementation.

Also, this way, there is no need to store multi-char-decoding continue addresses, since the algorithm simply can fetch the next byte as needed. Except if it reaches the end of the buffer, when it simply copies the 1-3 unprocessed chars to the front, and finishes running, and the system waits for an other buffer flush.

The only drawback of this approach is that, you won't see anything while you are typing, since the buffer is not full yet (most probably). However, most of the programs are spending their time waiting user input, by calling "chin" procedure in the BIOS. If no key is pressed, so the input buffer is empty, the BIOS is waiting in a loop for a new char. This loop can be used to flush the buffer, at any filled up state. This was almost good, so far, however the clever programs used instead the "chstat" procedure call, to check if there are chars waiting to input, so, no flush again... until I have added a countdown to that procedure as well, which when reached 0, called the flush. OK! Now you see "instantly" what you are typing. But the fe in compile time, when the programs do some work, and don't expect any input, never checks the input line, so even if they update the screen with information on their status, since no flush occurs, you will not see it. Or, even worse, you will see some half rows, ended in the middle of a word. That's why the disk status indicator proc also got the countdown, to be able to flush the buffer.

The results? VDO (which is a memory only text editor), displays screens, and pages of text noticeable faster! What about games? I guess action games will not work... Contact me, if you are interested in testing.

2015. január 25.

Commodore 64 tisztítás

Ez a C64-es annyira olcsón kellette magát, hogy nem tudtam ellenállni, meg kellett vennem. Ugyan látszott a hirdetés képein, hogy itt-ott hozzányúltak, de ha más nem, alkatrésznek jó lesz! Az előző tulaja szentimentális búcsút intett neki, gondolva ez a gép itt fejezte be a pályafutását. A géphez még tartozott egy rébbi 1541-es drive, illetve egy C-Lab Midi interface kártya.

Haza vittem, bekapcsoltam, és működik. A táp rendes 5.2V feszültséget ad, a képe szép, hangja van. Mi kell ennél több? Csak a hátulján az a ronda plusz csatlakozó ne lenne! Meg a felirat az elején! Az 1541-es is működik, bár időnként éktelen hangja van. A gép házán már kívülről is látszott, hogy jó poros közegben tárolták (pedig a vásárlásra letörölgették kívülről), az alján még valami friss festékszerű is volt. Az 1541-es szintén moddolt egység: egy kapcsoló és egy plusz LED éktelenkedik az elején. Arra nem kaptam választ, hogy mire való, az előző tulaj sem tudta (így vette). A meghajtó háza pedig koszos, és festékmaszatos helyenként.

Innen indultunk
Nagyon érdekelt, hogy az a LED + kapcsoló mire való, így gyorsan felnyitottam. Mint kiderült, egy csavar hiányzott a házból, egynek meg körbeszaladt a menete, amikor legutóbb valaki erővel próbálta meghúzni azt. Így gyakorlatilag csak 2 csavar tartotta össze a gépet. Felnyitva óriási por és dzsuva fogadott odabent, amit gyorsan kicsit lelegyeztem róla. Az oda nem illő vezetékeket végigkövetve, azt találtam, hogy a LED-et közvetlenül kapcsolja, illetve egy másik ág rövidre zárja a P6 csatlakozón található írásvédelem érzékelő két lábát: ebbe a meghajtóba olyan floppyt is bele lehet rakni, aminek nem vágják ki a szélét, és lehet vele írni, hogyha ég a piros LED. Zseniális! :)
Van kosz! :)
A kivitelezés házi megoldásnak elmegy, de nem különösebben szép megoldás. Ezzel a floppyt össze is szereltem, és félreraktam máskorra (a pucolása, és a mechanika tisztítása, zsírozása igen időigényes).

Töprengtem, hogy mi legyen a C64-essel. Végül eszembe jutott, hogy tök szerencsére a donor gép alja ugyan ilyen típusú, és az nincs kivágva, csak koszos, és lehet hogy kicsit karcos. A tetejéről pedig talán lekaparható és lesikálható az a "Home computer" felirat. Neki is estem sebtiben.

WTF??
Szétszedve itt is hatalmas por-oroszlánok fogadtak, de semmi vészes, az itt-ott felszíni rozsdafoltokat leszámítva. És, amivel még nem találkoztam C64C-ben: fémlemez volt az RF árnyékoló/hűtő a NYÁK felett, mint a C128-asokban. Ezeken vannak nyúlványok, amik egy-egy melegedésre hajlamosabb IC-t érintenek (nem túl nagy felülettel, így nem valami hatékony). De, még mindig jobb, mint az alufóliával bevont kartonlap, ami az elterjedt megoldás volt.

Nincs kosz! :)
A sikálás Domestosos dörzsi szivaccsal a koszt pikk-pakk eltávolította. A feliratot már korántsem ilyen könnyen: azt egy éles bicskával kellett végül óvatosan lekapirgálnom. A donor gép alja jobb állapotban volt mint a teteje szerencsére, és a két gép színárnyalatában sincs nagy különbség, mint kiderült. Összeszerelésnél még a hűtött IC-k kaptak friss hőpasztát, az RF árnyékoló lemez hűtő karmantyúit nagy gonddal ráigazgattam (érsd: addig hajligattam, míg megfelelően felfeküdt) az IC-kre, és kész is volt!
Nincs módosítás!

Vagyis még nem! Hiszen az alsó borításnak a cseréjével a rajta lévő matrica, is kicserélődött, és nem az a gép van benne, amire a matrica utal! Így még ezeket is felcseréltem (elég jól, egyben lejöttek, miután a sarkukat felpiszkáltam), hogy ténylegesen az eredeti gépet kapjam. Elvégre egy Commodore többek között ettől is Commodore... hogy a hátulján is a saját logója szerepel, a saját születési anyakönyvi kivonatával.

2015. január 11.

CP/M on Commodore 128

CP/M modified by ME, booted up
I have downloaded the original release of CP/M for Commodore 128, and also tested Microsoft Multiplan on it, which is the predecessor for Excel. The speed was more than unsatisfying. You can imagine the situation sitting in front of your computer, waiting the initial screen to appear, and watch the screen displayed line by line, character by character following the movement of the cursor with your eyes. It is sloooow. Not just comparing to today's computing experience, but I would have been upset back at those days as well. The C64 version of Multiplan was lightning fast compared to what CP/M produced.

But before we deep dive into things, let's take a look at what that "seepeeperem" is. Originally developed by Digital Research Ltd for Intel's 8080 CPU in 1973, it was a console based operating system, much like the DOS, or the Linux. In fact, it was the predecessor of Microsoft DOS in some way, since Microsoft wanted to provide some functional compatibility for CP/M on the x86 systems. The Zilog Z80 CPU is an Intel 8080 binary compatible CPU, extended with several instructions, and some registers. This Z80 CPU is also part of the C128. Yes! The Commodore 128 has two different CPUs: MOS 8502 (which is an enhanced 6510, which is developed for the C64), and a Z80. The Z80 is only used for running CP/M.

Compiling CP/M in C128 VICE
When CP/M boots up from floppy, it provides a command prompt, much like DOS did later, with some familiar commands, like DIR, ERASE, etc... However there are differences as well, the COPY command in CP/M is called PIP. Also, CP/M didn't supported directories yet, it instead used some kind of user partitioning of directory entries from USER 0 to USER 15 (no passwords, or anything, so it is much like numbered directories of some kind).

CP/M run on a lot of 8080 and Z80 CPU based computers of it's time, having very different hardware architectures. Digital Research designed the OS that way, to make it possible. The basic concept was, to have a hardware specific BIOS (also loaded from disk), which is some kind of an hardware abstraction layer, on top of it sits the BDOS, which is invariant, and these two loads CCP.COM which is the COMMAND.COM for CP/M, handling the command prompt, user inputs, command and program execution, etc. Under the BIOS, there are the ROM based routines to handle screen, disk IO, and booting CP/M from disk.

Fortunately enough, Commodore made open source their BIOS version, to allow anyone to modify it's source according to their need. I readily found a so called Fast BIOS R6.2 on the net, which eliminated a good portion of unnecessary code from the BIOS, and made some shortcuts on the display parts to make screen handling faster. This code is dated back to 1993. However, it wasn't fast enough for me. So, I decided to speed it up even more. I also managed to get the source of the ROM functions found in the C128, so everything were at hand to make C128 CP/M a better world to live. But this will be an other post.

MS Multiplan, predecessor of Excel
I finally managed to introduce some tricks in the BIOS, which made a nice speed up in display times (by a factor of at least 50%), which is getting closer to acceptable speed.

I wonder, what is the reason of this slow CP/M functionality on Commodore 128. Probably the problems are manyfold:
- Z80 and 6502 assembly developers that time hated each others' architecture like hell (comparable to the Linux vs Windows flames experienced in the early 2000's)
- The star of CP/M already started to diminish the time, when Commodore came up with the C128
- The new OS for IBM XT was MSDOS, instead of CP/M
- Good, knowledgeable developers were rare that time
- The user base of C128 CP/M was too small, which made the developers to turn away from C128 CP/M development
- The Z80 CPU run at an effective speed of 2MHz, instead of 4MHz, which would have been comparable to the 1MHz mode of 8502 CPU, or to other CP/M running HW that time

2014. december 11.

An easy repair of a C64

Dirt and spilled capacitors
This Commdore 64C was in good condition for first sight, and worked besides some minor problems, like defective "0" key, and didn't have sound. Adding a spring from my donor C64 to the keyboard, for the missing "0" key was a 1 minute fix. However, opening up the case afterwards was surprising: this later C64C had a casing where there were no screws just plastic hooks to snap the keyboard in place, and snap the whole housing together. It seems to be a cheap solution, however was easy to open up for fixing.

Nice and clean, with new caps
Inspecting the motherboard, in general it was in good condition, however some spilling under two electrolytic capacitor grabbed my attention. Also, the fuse looked strange for me, it seemed to be home renewed: the hair thin burning wire run outside of the glass, and it was soldered to the fuses metal ends. WTF??

Soldered out the capacitors, and washed the main board to get rid of the remains of the fluid on it. Swapped the fuse from the donor, and soldered in the donor capacitors. Anyways, having the capacitors soldered out, I took the opportunity to measure it's properties. Turned out, that even the original capacitors were within specification, however the ESR values were 1.5, 2 times as high as the new ones.

Testing, testing...
Powering up the board, checked the voltages on SID, and I have found everything OK. The SID (the newer 8581 version) requires 0V (GND), +5V and +9 volt. I swapped with a known working one, for testing purposes. And let there be music, I said. And so, there was.

Hitech quick dry procedure
One thing left for the end, cleaning the bare casing thoroughly. All of those small black scratches, old dirt went away, and assembling together again when it dried out, we were ready to play a little bit. :)
Ready to have fun!

2014. december 8.

Repairing Commodore 1351 mouse

I have a Commodore 1351 mouse bought ages ago, for chips. It wasn't functioning properly, since the horizontal movement didn't work. It was sitting in the drawer, waiting to be repaired, until this week. Since I managed to copy GEOS to a spare floppy disk, with my new ZoomFloppy device, it was high time to use it. The symptoms are: it moves the cursor up and down properly, however no horizontal movements at all.

Opened up the casing of the mouse, I found it quite dirty, collected a lot of small particles everywhere around the sensing wheel as well, so my first move was to get rid of that oily dirt, and clean the casing too. The easiest way to clean the PCB, and grease, particles, is to use break cleaner spray used for cars. It dissolves every kind of oils, and sticky dirt, and sublimates very quickly leaving a clean surface afterwards. For the housing I used Domestos, an aggressive whitening cleaner could be easily obtained here around.

Small blue spots are the IR emitters
Cleaning wasn't enough though. I quickly checked the cable with multimeter resistance measurement, looking for incontinent, however I have found everything all right. My next move was to observe whether the infrared transmitters emit light or not. It is a little tricky, since you can not see IR light, however, digital cameras can... like the ones can be found on smart phones. You just need some darker places to see those small bright spots. As you can observe on the picture I took, those IR transmitters are visible as bright blue spots on the picture. You could also observe, that one of them (lower right hand corner) is emitting dimmer than the others. This could be a problem, since probably it's light is not enough to sense movement. Probably that particular LED is getting worn out, but still operational though.

Blue resistors are the new ones
Since I didn't have any spare parts to replace those, and didn't even seemed to be an easy run, I checked the device further. Putting to good use my oscilloscope again, measuring all of the IR receivers on the other side of the wheels, opposite to the IR transmitters, while I was rotating the wheel in front of them. As I measured, I realized that the ones associated to vertical movement, modulates the 5V power source between roughly 0V and 3.8-4.1V. However, the receiver on the X axis, opposite to the brighter emitter modulates between 0V-3V, and the one opposite to the dimmer emitter between 0V-1.8V. But at least, it was a sign, that the receivers are also in working condition.

Commodore 1351 connected to C=64
Traced back the PCB from the IR receivers, I concluded that it works the following way: they are sourced from the 5V power line, and connected to the IC with different kind of pull down resistors, to make the 0V when they don't see any IR light, and closer to 5V when they are. However, I was surprised, that every IR receivers had different pull down resistors in place, probably manufacture time compensation of small differences. The 4 resistors varied from 5.5kOhm to 12kOhm. I quickly need to add, that the two smallest resistors were connected to the X axis receivers. This means, that probably sometime they were capable to drive more current, either because the emitters were brighter, or the receivers degraded by time. So, my theory was: swapping the two small resistors for bigger ones, makes the receivers pull up the line more easily, which means higher amplitude oscillation compared to 0V-1.8V.

C=64 with 1351 mouse, running GEOS
At first I soldered out the two resistors, and added 9.9kOhm ones instead. Checked again on the oscilloscope, nice high amplitude produced by all receivers. Still in the taken apart state, I connected to the C=64, loaded up GEOS, and tested rotating with fingers the individual wheels: works perfectly! Nice job! Assembling together with it's house, I was eager to click around in GEOS... and came the disappointment: the X axis didn't work again. Taking it apart again, checking soldered connections again, everything is fine. Connecting the raw PCB to the C=64, it also works fine! Ok, probably it was some temporary thing, maybe a connection problem. Assembling together again, and testing: X axis doesn't work again. Hmm... probably the PCB, and the housing of the wheels + IR emitters and receivers bends, when I tight down with screws, and gets the two receivers out of alignment. I have loosen the lower screw, and TADA! Works! A little bit unreliable on the X axis sometimes, but at least it works. Now I know, it is a misalignment issue from now on (mechanical).  But at least it became usable. I have a working Commodore 1351 mouse finally!

2014. december 4.

Connecting Commodore floppy to Windows 8.1 laptop

CBMXfer, finished copying GEOS
Back at days, when I had last time a desktop PC at home (it was an AMD Athlon 2500+) in around 2000, it had a conventional parallel port. I was also able to boot it up in MSDOS 6.2, to make exclusive use of that mentioned parallel printer port to connect my Commodore 1541 floppy with StarCommander, and make file transfers back and forth. However, since than, I only had laptops, not having parallel or serial ports, but still wanted to connect my old floppy drives to PC somehow, to transfer those zillions of D64 images I collected from net, to test on actual hardware.

Laptop using Commodore 1571 drive
Now days, I need to say, the most comfortable way to command your Commodore IEC drives (Commodore 1540, 1541, 1570, 1571, 1581, etc...), is to get your hands on a ZoomFloppy device, also known as xum1541 cable. This is a micro controller based USB device, accompanied with drivers for Windows, and some command line utilities to do actual things with it. I also looked up the ebay to find some implementations, since I didn't want to bother making it myself.

I ended up buying 8_bit_fan's smaller implementation, not having IEEE-488 port. The product arrived without any software bundled with it, so I needed to look up, and download everything I needed to make it work. At least, it wasn't expensive. OpenCBM is compatible with this solution, however, the latest version didn't contain the support yet, so I needed to download a prepacked, xum1541 supporting OpenCBM verison, directly from ZoomFloppy's website. Installing the drivers wasn't smooth, since there is no official support for Windows 8.1. The problem is that the USB driver is not signed, so by default, Windows 8.1 won't allow you to install it. To workaround this problem, you can hit the restart while holding down the shift key, in the power drop down menu, on the start screen, to restart your computer in maintenance mode, and selecting the "Disable signed driver constraint" or similar by pressing F7, you can boot into an operating mode, where you can install the driver, even though it is not signed. Rebooting afterwards in normal mode/way, and you are done. Otherwise you just need to follow the steps in the manual you get.

I have found command line operation cumbersome, so I downloaded CBMXfer also. To make work properly, you'd better place it in the ZoomFloppy's version of OpenCBM bin directory, and run it from that location. To make it even more convenient, you should also download and install the latest VICE 6502 system emulator (C=64, C=128, PET, etc...), and copy c1541.exe from it's directory to the same directory where CBMXfer is.

This way I can access my Commodore 1541, 1570, 1571 drives with no hassle, and even brows files stored in the D64 disk images, brows the net, and display the screen of my C=64/128 simultaneously using AVerTV on my Windows 8.1 laptop. :)

2014. december 2.

S-Video cable for Commodore 64 & Commodore 128

Since I got rid of my TV half a year ago, I only use an AverMedia USB hybrid TV dongle for vintage computer video display. I experimented with UHF RF output, with minor success, and also converted one of my C=128 monitor cables to give composite picture. However, it wasn't satisfying enough, so I decided to make an S-Video cable, that can be also attached to my USB dongle.

What is the gain in it? One would ask. Well, let's dive into a little bit of the different video formats first, and how the Commodore 64 produces those. The Commodore 64's VIC chip outputs chroma and luminance signals separately. This is the source of everything displayed, in any format. The luminance signal is essentially an old school black and white signal, which even by the oldest B&W televisions can be decoded and displayed, provided they are working with the same 50Hz mains, since their timing is closely related to that frequency source. The chroma signal in the other hand, is a PAL encoded color information, appropriately synchronized with the luminance signal. After some amplifications, and line separator circuitry, those are available as output as well. However, the amplifier module also mixes the two signals together, producing composite output. This one also can be found as output on the Commodore 64. Mixing the composite signal again with the mono sound channel data, encoded into the picture frames, and putting all these things onto a UHF carrier frequency produces the PAL RF output, which can be tuned on a TV, around UHF channel 36.

AverTV C=64 S-Video screen capture
Since S-Video is essentially a separate chroma and luminance signal carrier plug, we can see, that we would be able to ignore all of the possible distortions added with mix-matching all other signals, to ultimately produce composite, or even worse, RF output.

Quickly looking up the net for a wiring diagram, for SCART cable (which also contains the S-Video signals too), and an S-Video mini-DIN plug pin arrangement, I was ready to solder things together. Since S-Video signal doesn't contain sound, I also needed to make a separate RCA connector for that, on the receiver side, next to the S-Video connector.

The first tests showed flickering colors, even flickering screen, in fact it looked even worse than it was on the composite. At first sight I was very disappointed, but after that I recalled that I red somewhere that the Commodore 64/128 chroma signal is too strong for modern TVs, for their S-Video connection, so somebody installed 330 Ohm resistor in the way of their chroma signal cable. Looked around, and only found 200 Ohm resistor at hand. Quickly modified the cable, added that resistor into the C=64 DIN connector housing, and TADA! Works! Great! Finely detailed, vibrating colors, crystal clear display! By the way, grounding the sound input pin on the video connector really makes a difference, by significantly lowering static whoom noise.

2014. november 25.

Commodore SR4148R restoration finished

Hello from Commodore :)
Last time, I have installed a temporary alkaline battery pack into the calculator, to try whether it works or not. After that, I looked up the internet, to collect information about the AC adapter. I have found that, the original could provide 6V 400mA DC, through a normal, mono 3.5mm jack plug, where the pinhead of the plug is the positive polarity.

I ordered a configurable AC adapter, with 1A output, and option to set voltage from 3V to 12V. Also got a 2000 mAh NiMH battery pack, which is a low self-discharge version, instead of the original 500 mAh NiCd pack. Since the original pack was designed to 50 mA charge for 16 hours, there is no charge termination circuitry implemented inside. Which is fine for a NiCd battery. Fortunately, there is not much difference between the charge profiles of NiMH and NiCd, however a bigger capacity battery would miss the C/10h constant charge (fe.: 800mAh/10h=80mA), never charging up the batteries. However a low self-discharge version of the battery will be satisfied by the lower current.

Swapping the packs, and turning the calculator on, everything was fine. Plugging in the adapter I could measure 60 mA charge flowing into the pack, just as I expected.

It seams, that the device is expecting the battery inside heavily as a mediator/regulator, since not having the battery inside, just plugging in the adapter didn't do anything usable, just random characters on the screen (probably too low voltage for operating, didn't debugged any further).

Quickly made some new pictures, and TADA! Ready to use... erhh... charge. :)

2014. november 15.

Commodore calculator SR4148R repair

Last week I managed to put my hands on a 1974 Commodore SR4148R calculator. It was said to be non working. Never the less, I was thinking that this one seems to be in very good visual condition, just a little bit dirty, and in worst case, it could be used as a spare part donor, whenever I manage to get an other one. There was unfortunately no leather case, nor AC adapter packed with it, and the operating manual was also missing.

Getting home, I quickly opened the case, and saw that the original 500 mAh, 3 cell NiCd battery pack was in very bad condition. Electrolyte was flown out of the batteries, and made a big mess all over, inside the casing.

My first move was to take it apart, into as small pieces as I could, and wash the casing, and display. I soldered out the battery pack, and unscrewed the jack plug to be able to remove the display from it's place, and unfold all of the electronics, which consist of two PCBs, where the button back panel is a double sided PCB, and the logic board is a single sided, through hole mounted one. Awesome! The display has a series of small lenses in front of the very small LED display, melted together.

As I took it apart, when unscrewing the back panel of the keyboard, I had the feeling getting stronger and stronger, that the keys would be something very unusual these days. When lifting off finally the panel, I saw the following: every key on the keyboard is a separate small piece of plastic, with rubber/carbon circuit touch contactors, and a small spring for every single button. It also seems, that the buttons are not just simply painted ones, but there must be some protecting layer above the paint, preventing the signs to wear off. All of these features add a very pleasant, and very distinct touch feeling of the buttons, even though they are small.

I have the feeling, that this calculator was designed for eternity. The buttons practically were never meant to wear off, the PCB is small, simple, through-hole type, and very easy to fix, in case something goes wrong. Since I didn't have any jack plugging adapters right at hand, I decided to quickly wire up a small temporary replacement battery pack, from AAA alkaline batteries, just to try whether the thing as operational at all. Turned on, nothing happened. Measured the electric flow, and it was 800mA when turned on, but no display. There must be some shorts, or disconnects.

As I suspected, I have found some disconnects, since the electrolyte during the years managed to make complete PCB track segments to disappear. I have created some jump routs out of wire, and TA-DA! It works! It's consumption is around 70 mA, when simply turned on. Put together everything, and started to joy-key on some expressions.

Testing it I started to like it more and more. There are three blue keys on the top, marked EE, EE *down*, EE *up*. I have never seen such thing before. Ok, the EE is quite self explaining the exponential enter button, however with the other two, one can modify the punctuation on the fly, converting even a calculation result into other exponential result. This also makes counting 10s, 1000s, millions, very easy! I have also discovered a bug! 2^31 is OK, However, 2^32 is 4294967297 according to the calc, instead of 4294967296. However, when I divide the result of 2^32 by 2, I will get the correct 2147483648.
Even more strange, when I type in 4294967297, and divide by 2, I will get the mathematically correct 2147483648.5 as the result. 2^33 is also problematic, it is also bigger by one then the correct answer. Strange. I also very much like the small, thin LED numbers, and the strange delay we are not used to these days, when hitting the equals sign. :) After all, it is a very attractive, good to handle small scientific calculator, which was made for eternity! :)

Update: testing further the x^y functionality, it seems that it is a rounding problem inside the calculation, since 2^3-8 yields 1.6E-10. This also means, that the internal floating point representation is more precise than 10 decimals. Since single precision floating point numbers (32bits) can represent only 2^23 precision, it is too small for that purpose. Double precision (64bits) however would be a waste. My guess is it uses some arbitrary floating point representation, like 1bit sign, 8bits exponent, and at least 35bits fraction, which gives at least 44bits all together. Strange.

2014. november 10.

How I rescued a Commodore 128

I have got a Commodore 128 for free, when buying some Polski Fiat 126 parts some times before. The C=128 was waiting in his ashes, to rise, since it couldn't be turned on, and got some other issues as well.

When I pulled it out last weekend from the storage, to take a closer look, I instantly realized that the main problem was the power switch. Took one of the spare part C=64 as well, and soldered out the switch and installed it on the C=128. Checked, connections are OK, power is OK. However, there was a small discontinuity on the ground connection for the power LED. Soldering done, and shines as before.

Checking luminance on VIC
Since I didn't have an analogue TV at hand, I used my laptop with AverMedia Hybrid USB TV, to capture the display of the machine. First, I connected it to the RF antenna slot, to try to tune in the C=128 boot up screen. I only got screen pictures for some prompt times, mainly static pictures buffered by the TV card. And it was all black & white. I tried to fine tune, without chance, also tried to fine tune the RF modulator on the Commodore. The best I could get with PAL settings, is a black & white picture scrolling upwards, with great flickers on every second row. Also connected the video output to the composite in of the TV card, with the result of somewhat nice picture... in black & white.

C=128 main board
I quickly opened up the troubleshooting guide (which is for NTSC versions anyways), and followed the steps to narrow down the problem. Fortunately I have an old analogue oscilloscope, with 20 MHz measurement frequency. I quickly checked the different clock lines on the motherboard, and measured their frequencies with a rough estimation, since there is no such things on this 'scope as freq counter. The pin 16 of the VIC chip gives the luminance encoding, and pin 17 the chroma. Both were OK, however, the chroma seemed somewhat low on amplitude.
Donor C=64
So either the chip, or the M1 (the RF modulator) was faulty. Anyways, it seemed unreasonable, that the VIC chip give good signal with bad amplitude, so I turned to the RF. The modulator also contains an amplifier for the luminance and chroma output for the video connector. I measured with 'scope, and got a pretty distorted, low level output on it. So, the problematic part should be the RF modulator's chroma amplifier.

C=128 & C=64 RF modulator
I quickly soldered out the modulator from the C=64 in under 2.5 hours (since practically it is the same as the C=128 has). The procedure was pretty frustrating, not having the right tools to do it. What I missed for this action, is some kind of an IC pin heater head for my soldering-iron, and a solder sucker pump. Anyways, in 4 hours, the "new" RF modulator was in place in the C=128. Check with the oscilloscope: higher amplitudes on VIC chip, less distorted and higher level chroma on the video connection.

When I connected to the TV card again, with composite, from time to time, colors appeared and disappeared, wasn't usable. On the forums I quickly searched through, somebody mentioned that the frequency of the PAL oscillator crystal is very important, and should be very accurate. I didn't have a chance to measure frequency as accurate as 8 digits on an analogue oscilloscope, unless the 'scope can do XY plot option, and have an accurate freq generator. I lacked the later one, so I went blind. Exchanged the xtal and the variable capacitor from the C=64, and fortunately enough, it did the trick!  :)


Now I have an (other, also) fully functional Commodore 128, in nice visual condition. Later, I will try to test it also in 80 column mode, when I have a chance.

Also, I have a newcomer, an even older, Commodore CBM 720 to be restored. But this will be an other story.