• Please review our updated Terms and Rules here

Stèphane's and Alex' PET ROM checks

Yes, the 6522 touches many circuits. It has some of the IEEE 488 handshake signals, the User Port, and the cassette #2 READ signal.

Does it also have the internal counter that creates the jiffy clock interrupt?
I *think* that the timers in the 6522 are only used for the cassette and IEEE routines, and the jiffy clock is derived from the screen refresh.
 
Today or tomorrow i'll try as Carlsson with & withot all big chips... i haven't try yet! I hope mainboard is ok because works when Carlsson shipped me. Many things can make it function / non function, if PET boot ok one more times i can check voltage on chip and make a basic memory test so i can check it.
 
Today or tomorrow i'll try as Carlsson with & withot all big chips... i haven't try yet! I hope mainboard is ok because works when Carlsson shipped me. Many things can make it function / non function, if PET boot ok one more times i can check voltage on chip and make a basic memory test so i can check it.
Removing the 6502 won't really tell us much so you might as well leave it installed. Let's see first if you get as far as the BASIC prompt with all the other three (2x6520 & 1x6522) removed.
 
I *think* that the timers in the 6522 are only used for the cassette and IEEE routines, and the jiffy clock is derived from the screen refresh.

Mike,
The best I can tell on the 3000 series machines, the interrupt probably comes from the "Video On" signal into the CB1 input to the C7 PIA. The PIA can be programmed to create an interrupt when a pulse is detected on the CA or CB lines.

I guess this assumes the "Video On" signal has a 60 Hz frequency. I also see some count correction logic in the interrupt handler routine.
-Dave
 
Mike,
The best I can tell on the 3000 series machines, the interrupt probably comes from the "Video On" signal into the CB1 input to the C7 PIA. The PIA can be programmed to create an interrupt when a pulse is detected on the CA or CB lines.

I guess this assumes the "Video On" signal has a 60 Hz frequency. I also see some count correction logic in the interrupt handler routine.
-Dave
Yeah, I think the video interrupt is a little faster than 60Hz so it skips every 600th or so count; I think the 50Hz machines use different E ROMs so they presumably adjust the jiffy clock differently.

What are you looking at BTW? Have you got disassemblies of the ROMs?
 
Yeah, I think the video interrupt is a little faster than 60Hz so it skips every 600th or so count; I think the 50Hz machines use different E ROMs so they presumably adjust the jiffy clock differently.

What are you looking at BTW? Have you got disassemblies of the ROMs?

Yes, the diassemblies are on Zimmers I think. Here is a fragment of the Jiffy counting in the interrupt handler (BASIC 4) with the correction for every 623 clocks:
Code:
; Update Jiffy Clock

 F768    iF768    INC $99     ; Jiffy clock correction: 623rd 1/60 sec does not increment time
 F76A        LDA $99         ; Jiffy clock correction: 623rd 1/60 sec does not increment time
 F76C        BNE $F770
 F76E        INC $9A
 F770    iF770    CMP #$6F     ; Compare low byte 026F = 623 decimal
 F772        BNE $F77A
 F774        LDA $9A
 F776        CMP #$02        ;026F = 623 decimal
 F778        BEQ $F79B
 F77A    iF77A    INC $8F ;Jiffy clock count stored in zero page locations $008D-008F
 F77C        BNE $F784
 F77E        INC $8E
 F780        BNE $F784
 F782        INC $8D                ; Real-Time Jiffy Clock (approx) 1/60 Sec
 F784    iF784    LDX #$00
 F786    iF786    LDA $8D,X        ; Real-Time Jiffy Clock (approx) 1/60 Sec
 F788        CMP $F7AC,X         ; ?    DATA
 F78B        BCC $F7A1
 F78D        INX
 F78E        CPX #$03
 F790        BNE $F786
 F792        LDA #$00
 F794    iF794    STA $8C,X
 F796        DEX
 F797        BNE $F794
 F799        BEQ $F7A1
 F79B    iF79B    LDA #$00
 F79D        STA $99     ; Jiffy clock correction: 623rd 1/60 sec so do not increment time
 F79F        STA $9A
 F7A1    iF7A1    LDA $E812
 F7A4        CMP $E812
 F7A7        BNE $F7A1
 F7A9        STA $9B              ; Flag: STOP key / RVS key
 F7AB    iF7AB    RTS
 
So would this explain the slight jitter in video output when I removed the 6522 from my 3032? It tended to automatically swap between upper and lower case too, but no other garbage.
 
So would this explain the slight jitter in video output when I removed the 6522 from my 3032? It tended to automatically swap between upper and lower case too, but no other garbage.
Anders,
This code corrects the jiffy count only; it does not effect the frequency of the video signals.

However the 6522 VIA is the source of the signal called "Graphic" which goes directly to the upper address line of the character generator ROM and selects the other character set. So yes, if the line is open and noisy, it would cause the effects you saw.
-Dave
 
Last edited:
:D
Yesterday arrived new 6520 & 6502 big chips and few minutes ago i've make a test... here is results...

img0068aap.jpg


EUREKA!!! :thumbsup: It works!

I've make only a little basic program that print some words on screen in loop and seem ok after 10 minutes. Only 6502 chip (main cpu) was a bit warm, is it right?

In next days i make several test also with floppy... i'm really happy!
 
Nice! We'll all keep our fingers crossed that your PET remains happy and cooperative for several weeks, months and years.

If the opposite happens, that it goes dead again, it will be an interesting case of troubleshooting but let's hope we don't have to go there. I suppose you don't want to swap around chips and test your old board.
 
Thanks Dave & Carlsson ;)

Now i'll work around to transfer program in basic from pc to PET... i've see a "strange" interface on a retro-site.
Otherwise i type programs as i made many years ago :D

@ Carlsson: As you say now i prefer to make all test with this configuration... with fingers crossed ;-)

Next days, hard work for PET! :cool:
 
Last edited:
Congratulations!

I'm trying to find the best way myself of transferring files to/from the PET and PC; where is this "strange" interface?

And what is everybody else using?
 
As many of those oldies who populate this list will know (old as in who have been on here a year or two..although a more literal meaning may also apply :)) I used a fairly convoluted way to get Pet programs to my CBM 3032 from a D64 disk image after the machine was repaired/fixed with the help of this community.

However, of late I've digitised and uploaded some Pet Programs as TAP files to the Web. Once converted to WAVs these should be able to be used directly by using the PC sound output to either make tapes or connect to the PET directly through some kind of adaptor, without messing about with all that C64<-->Pet conversion stuff.

The Pet files are on a commercial fileserver for which my monthly 25GB bandwidth allocation gets gobbled up regularly. If a downloading attempt says the bandwidth is exceeded, wait until just after the first of the month (after the allocation is reset) and try again. I can't try it at work here to check as file storage sites on the Web are regarded by my employers as undesirable sources of copyright breeches and malware and are blocked by our filewall!

Well done on getting the Pets going BTW. Great to see the Pet hospital is still in operation and still staffed with enthusastic volunteers :D

All power to you guys!

Tez
 
A lot of other people keep mentioning the ZoomFloppy, which I'm sure in the long run will prove a very useful device. I don't know if the software support as of today makes it superior though, but it should be worth looking into. Of course it all depends on which other devices you have. If you own a 4040, a 1541 and a X-series cable, you can write floppy disks on the 1541 that will to the most part be readable on the 4040. If you have a C2N232 or at least a prlink or PC64 cable with some bootstrapping software either on tape or an utility EPROM, it might prove a meaningful way to transfer software from PC to PET. Tezza's method of converting PRG to TAP to WAV also works if you have a C2N to the PET. Eventually I'm sure someone (the ZoomFloppy?) will have functionality to use SD memory cards just like the sd2iec and uIEC/SD series work on the later Commodores.

I still believe the "C2N2IEC" hack as implemented on the CBM-II series computers should be possible to implement on various PET models too. Someone "only" needs to adopt Micha's latest bug-fixed firmware and adopt it to run from e.g. a $9000 EPROM. Once there, by using a reasonably simple adapter perhaps connected to tape #2, we would get slow IEC and thus also sd2iec options without no additional high-level interfaces.
 
Right Carlsson, "strange interface" is C2N232... where we can find that? On Marko Mäkelä webpage ther's no contact to make order.

Thanks to Tezza now i download TAP files, convert in wav and then record to tape and after... many happy hours of retrogaming with PET ;)

On PET mainboard i've others two eprom empty slot, which "basic expansion" can i burn and fit in?
 
The C2N232I can be ordered in parts from Nicolas Welte. Due to practical reasons he doesn't offer it ready built anymore. It requires skills in soldering SMD (surface mounting details) though, so not easily assembled for beginners.

I'm afraid the IEEE-488 interfaces on an ISA card will not assist you, as there likely is no software written to communicate with a Commodore floppy drive or computer through those interfaces. For that matter you could try to build a PC64 cable, something that I've never tried but have read should work similar to the C2N232 but slower and more work to set up.

There are a few utility expansions on Zimmers: here and here. I don't know which ones make sense though, in particular if you already have a Basic V4 ROM set installed.
 
Ok Dave, next days i'll try :)
Now i'm trying to format floppy on 8050 drive but all disks 5.25 that i try return ?BAD DISK error... could be basic V4 "incompatible" with 8050 drive?
I've also try to format disk in Olivetti M24 in "dos format" and all ok... another challenge between me and PET ;-)
 
Back
Top