View Single Post
Old 6th Feb 2021, 2:19 pm   #501
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,577
Default Re: Non-working Commodore PET 3016

I made the mistake of looking at that tutorial code to see how hard it would be to make it into a specific PET PROM reader and ended up with a more or less working version, so here it is.

In the attached .zip is a Raspberry Pi Python (.py) program file which reads every byte from every address of a 4K PROM and displays the code as 16-column hex. It displays the line start addresses and the ASCII equivalent of the bytes (where printable) to the right of the hex display.

It also calculates and displays the 16-bit checksum of the code which has been read out, which can be a useful first line check if you know what the checksum should be.

It's not completely finished, you could add code to either write each byte read out to a binary file so that the file created can be compared against a known good file, or you could have it open a named binary file and check (verify) each byte read out of the PROM against the corresponding byte in the file.

As has been said earlier, this Pi based reader -requires- level downshifters at least between the PROM data pins and the Rpi inputs used to read them, and ideally also level upshifters between the PET PROM address inputs, the CS1 and CS3 pins and the Rpi pins used to drive them.

You can run this in IDLE PYTHON 3 on the Pi although it will run at the speed of treacle due to the tortuously slow rate at which IDLE outputs text. Better to run it from a terminal command line, in which case you will need to make it executable by your user with

chmod +x petprom.py

after which you should be able to run it with

./petprom.py (if you are in the same folder as the file)

or just

petprom.py

.. if you place it in your home/bin folder.

I found that I could not use GPIO 2 as a _CE output because it had strange 'double' leading and trailing edges when used as an output - its 'other' function is as part of an I2C interface, although I do have all that turned off in raspi-config. I therefore moved the CS signals to GPIO pins 3 and 4 as shown in the drawing. While GPIO 3 is also part of an I2C interface it shows no adverse effects when used as a plain logic output and it happens to have a pullup resistor on it so it keeps the PROM naturally disabled unless it is intentionally enabled.

Also in the .zip file, the full sized version of the connection diagram attached below. Note the pin connections indicated are specifically for a 4K PET PROM.

As always this comes with no guarantees, if it breaks you get to keep both pieces.

'Error correction: PROM CS3 is pin 21, not pin 23 as wrongly indicated in the attached diagram below'
Attached Thumbnails
Click image for larger version

Name:	PET_PROM_To_RPi.jpg
Views:	48
Size:	71.3 KB
ID:	226070  
Attached Files
File Type: zip RpiPetPromReader.zip (162.9 KB, 36 views)

Last edited by Radio Wrangler; 7th Feb 2021 at 12:01 pm. Reason: Correction requested by poster. There is a corrected table in a later post
SiriusHardware is online now