UK Vintage Radio Repair and Restoration Discussion Forum

UK Vintage Radio Repair and Restoration Discussion Forum (https://www.vintage-radio.net/forum/index.php)
-   Vintage Computers (https://www.vintage-radio.net/forum/forumdisplay.php?f=16)
-   -   Raspberry Pi as a storage device for a PET. (https://www.vintage-radio.net/forum/showthread.php?t=179630)

ScottishColin 2nd May 2021 1:31 pm

Raspberry Pi as a storage device for a PET.
 
I have a few spare Pis around - I may try this and report back.

https://github.com/RhinoDevel/cbmtap....7.0/README.md

I'd be interested in other people's views.

Colin.

ortek_service 2nd May 2021 8:52 pm

Re: Raspberry Pi as a storage device for a PET.
 
Well it looks like it should work, if their software is OK - And certainly fairly cheap & low risk to try it.
It's mainly down to the software, as their interface should generally work OK
- Although it appears they've tried to bodge the RPi GPIO Output to CBM Tape Read input a bit with an extra 10k series-resistor from +5V to PNP emitter on this 3.3V to 5V level conversion transistor stage. So I'd do this a bit different, as that doesn't look like it would always work.

It doesn't appear that they've specified any transistor types, but it should work with an small signal ones like BC547 (NPN) & BC557 (PNP) etc.

I'd also be inclined to build it a bit more permanently on a bit of matrix board / veroboard, as parts are all quite low-cost, rather than using prototyping breadboard.


The RPi is a probably a bit overkill for this, and any Arduino using an ATMega328 uC- as used on the Tapuino Datasette Emulator - might have been easier, as most use 5V I/O levels. Although Tapuino is normally used with a small OLED display module + buttons for stand-alone use.
But it all depends on having on Arduino around already - Although it seems you can buy a complete assembled Tapuino board relatively cheap, and it should work on the PET if the tape format is the same as the C64/VIC20


Whereas an RPi (even a small Pi-Zero) should be capable of emulating the Disk Drive, as there are Pi1541 interfaces for the C64/VIC20 (IEEE-Serial lines only) disk drive interface but not sure if one has been done yet for the full PET IEEE Parallel version.
But should be able to do something similar to SD2PET
- Which gets a mention in an article on the PET & Emulating it etc. in the latest (June'21) issue of Linux Format Magazine (also has a Jupiter Ace feature, so quite a retro issue), I received a couple of days ago.

julie_m 2nd May 2021 11:01 pm

Re: Raspberry Pi as a storage device for a PET.
 
It's actually pretty ingenious! It looks as though the device sits on the tape port, you give it instructions by means of SAVE commands with special filenames, and it can also transfer files much faster than usual by not bothering to modulate its zeros and ones onto the customary audio-frequency carrier, and using a special driver on the Commodore machine which you can install just by LOADing a program straight from the emulated cassette.

I wasn't sure about the PNP transistor myself. I'd replace T1, T2 and T4 with something like an LM2903 dual comparator; signals from Raspberry Pi to each inverting input, both non-inverting inputs to +1.65V from 100K + 100K potential divider across 3V3 supply, 10K pull-up resistor on output going to pin 4 but not on pin 6.

Want me to try doing a PCB with BCP on an emulated BBC? ;)

Mark1960 2nd May 2021 11:16 pm

Re: Raspberry Pi as a storage device for a PET.
 
PET data cassette doesn’t use an audio carrier.

A small interface board might be an interesting demo of BCP.

ortek_service 3rd May 2021 7:38 am

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

Originally Posted by julie_m (Post 1370324)
>>
>>
I wasn't sure about the PNP transistor myself. I'd replace T1, T2 and T4 with something like an LM2903 dual comparator; signals from Raspberry Pi to each inverting input, both non-inverting inputs to +1.65V from 100K + 100K potential divider across 3V3 supply, 10K pull-up resistor on output going to pin 4 but not on pin 6.
>>
>>

If using an IC then any 74HCT inverting gate may be simplest, running off 5V supply, as HCT has a 1.6V typ (Max 2.0V) high-level threshold. Probably shouldn't need hysteresis, but could always use 74HCT14. And a few less resistors required

But if just got transistors to hand, then could just put a common-emitter inverter (e.g. T3 R8 & R7)) in feed from 19_bcm10 to R5 / R6 & bypass R4.
However this would then mean that data wasn't inverted so would either have to mod the software or put another inverting stage in front - if data polarity is significant (It wouldn't be for normal audio tones use).

Although, I reckon just removing T1 & R5 and connecting now free end of R4 to collector of T2 should actually work OK - just as done for the other direction - there shouldn't be too much load on PET, as straight to the VIA.

And you could always use a read-made level converter board, for both directions https://shop.pimoroni.com/products/s...7&currency=GBP
- Plus maybe the Sense control as well, although non-inverting, so would need to mod software for nSENSE at least.

SiriusHardware 3rd May 2021 9:04 am

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

they've tried to bodge the RPi GPIO Output to CBM Tape Read input a bit with an extra 10k series-resistor from +5V to PNP emitter on this 3.3V to 5V level conversion transistor stage.
Obviously the circuit must work as drawn as it looks like a mature and well tested project but I have to say that when I was attempting to read an EPROM with a Pi I originally tried just using series resistors as 'something for the volts to drop across', depending on what I assumed would be clamp diodes on the Pi's pins, and that did not work - the voltage at the Pi's input pin continued to be well above the safe input voltage even with the resistor value up into the hundreds of K.

I had to use resistor dividers in the end, to ensure that the +5V out from the EPROM was translated to a safe voltage at the Pi's pins.

I happen to remember that Colin does already have some of the little FET based level converters to hand.

ScottishColin 3rd May 2021 10:58 am

Re: Raspberry Pi as a storage device for a PET.
 
A board with any agreed changes (as above) would be awesome. PET Cassette port connectors seem easy to source too.

Colin.

SiriusHardware 3rd May 2021 11:54 am

Re: Raspberry Pi as a storage device for a PET.
 
Reading through the project details it seems to me that the originator has done a lot of testing, or a lot of testing has been done for him by friendly PET owners on a number of different PETs - my angle would tend to be that if it isn't broken, don't fix it. Just try it the way it is.

The only thing I could wish for is, if you were going to connect something as complex and powerful as a Pi, it might as well be emulating the FDD (ie, functionally equivalent to the SD2PET) rather than the datasette as that would seem like a better way to use one.

The Pi would then have to be interfaced to the IEEE 488 port, and that would present its own complications. It might be worth looking around to see if someone has already done it.

ScottishColin 3rd May 2021 12:25 pm

Re: Raspberry Pi as a storage device for a PET.
 
I wonder if this might also work with PETs?

https://www.ebay.co.uk/itm/Commodore...p2047675.l2557

Colin.

SiriusHardware 3rd May 2021 1:20 pm

Re: Raspberry Pi as a storage device for a PET.
 
That appears to facilitate the process I suggested elsewhere, essentially a method of hardware connecting two datasettes back to back, taking power from the PET.

julie_m 3rd May 2021 5:13 pm

Re: Raspberry Pi as a storage device for a PET.
 
I've now created a design in BCP based on the circuit! Details here, including link to SSD image.

This is very beginning-y stuff, and I have not even tentatively positioned any components yet ..... But nothing caught fire, which is good news, I suppose .....

ortek_service 3rd May 2021 5:59 pm

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

Originally Posted by SiriusHardware (Post 1370432)
Reading through the project details it seems to me that the originator has done a lot of testing, or a lot of testing has been done for him by friendly PET owners on a number of different PETs - my angle would tend to be that if it isn't broken, don't fix it. Just try it the way it is.

Yes, I presume people got this to work, but it maybe a bit marginal / may be putting > 3.3V into the RPi. And the PNP transistor doesn't really seem to be needed, as the 10k resistor in-series with +5V to it will be the limiting factor.
So might just as well had a standard resistor-pullup common-emitter NPN Inverter / level-converter , as used on the 5V to 3.3V opposite-direction write-line

Quote:

Originally Posted by SiriusHardware (Post 1370432)
The only thing I could wish for is, if you were going to connect something as complex and powerful as a Pi, it might as well be emulating the FDD (ie, functionally equivalent to the SD2PET) rather than the datasette as that would seem like a better way to use one.

The Pi would then have to be interfaced to the IEEE 488 port, and that would present its own complications. It might be worth looking around to see if someone has already done it.

Co-incidentally, I'd said exactly this a few posts before!

With the Arduino-ATMegea 328 based Tapuino the most common Datasette Solid-state replacement. Although it seems this RPi one has ways of increasing the data speeds, that might not be in the Tapuino as standard.


A Solid-state Disc drive replacement would be more flexible, and should be able to do something like the Pi1541 for the PET (Which having the full IEEE Parallel interface rather than Commodore's bodged cut-down Serial-IEEE, should also be much faster as standard).

But I hadn't noticed anyone doing one yet for the PET - Maybe as they aren't as common as the (World's best selling Home Computer - around 30 million sold) C64 etc. And maybe the SD2PET has now become the one everyone uses

ortek_service 3rd May 2021 6:16 pm

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

Originally Posted by ScottishColin (Post 1370437)
I wonder if this might also work with PETs?

https://www.ebay.co.uk/itm/Commodore...p2047675.l2557

Colin.

Quote:

Originally Posted by SiriusHardware (Post 1370458)
That appears to facilitate the process I suggested elsewhere, essentially a method of hardware connecting two datasettes back to back, taking power from the PET.


Yes, I see they also show / say it can be used with the Tapuino interface.
So might be an easy way to transfer cassettes to digital 'tap' files.

Although it seems some versions of the Tapuino do have an edge connector for connecting an original Datasette to - At least on the PCB-design that a friend of mine has done for this, that he's given me one I need to complete assembly of. So shouldn't need that 'clone' device for this version of the Tapuino at least (assuming that it does allow direct-transfer between it & the datasette).

SiriusHardware 3rd May 2021 6:41 pm

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

may be putting > 3.3V into the RPi. And the PNP transistor doesn't really seem to be needed, as the 10k resistor in-series with +5V to it will be the limiting factor.
I think we may both have been labouring under the same misapprehension Owen - the job of the R4 / T1 / T2 part of the circuit is to accept 0v/3V3 from the Pi (on the left) and supply 0V / 5V to the PET (On the right). So it's perfectly right that it takes its pullup from +5V through R4.

I think the circuit as drawn is probably fine, now that I am not looking at it cross-eyed.

Quote:

the (World's best selling Home Computer - around 30 million sold) C64 etc.
That record has apparently now been well and truly smashed by the Raspberry Pi.

julie_m 3rd May 2021 6:52 pm

Re: Raspberry Pi as a storage device for a PET.
 
My concern with the circuitry around T1/T2 is more with T1 possibly not turning off fully when the Raspberry Pi is sending a logic 1; although I decided to trust the original design, at least for the first version I tried in BCP. I did take the slight liberty of adding a Zener diode across R2.

ortek_service 3rd May 2021 7:13 pm

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

Originally Posted by SiriusHardware (Post 1370613)
Quote:

may be putting > 3.3V into the RPi. And the PNP transistor doesn't really seem to be needed, as the 10k resistor in-series with +5V to it will be the limiting factor.
I think we may both have been labouring under the same misapprehension Owen - the job of the R4 / T1 / T2 part of the circuit is to accept 0v/3V3 from the Pi (on the left) and supply 0V / 5V to the PET (On the right). So it's perfectly right that it takes its pullup from +5V through R4.

I think the circuit as drawn is probably fine, now that I am not looking at it cross-eyed.

Yes, I understood it is just a 0/+3.3V to 0/+5.5V (inverting) level-converter.
- But using T1 PNP transistor, to form a complementary push-pull output stage, means you shouldn't need an RTL style Pull-up.
So it should have either R4 OR T1. Having both seems rather pointless, as the output source-current is still limited by R4!


Quote:

the (World's best selling Home Computer - around 30 million sold) C64 etc.
Quote:

Originally Posted by SiriusHardware (Post 1370613)
That record has apparently now been well and truly smashed by the Raspberry Pi.

Yes, although it depends on if you classify the RPi module as a complete Home Computer (Although not much extra required - just Keyboard, mouse, monitor, PSU + Some firmware on an SD-card) , and you could buy a Starter kit with most of this).
But not sure if the Records-books have been updated, to the RPi yet.

ortek_service 3rd May 2021 7:24 pm

Re: Raspberry Pi as a storage device for a PET.
 
Quote:

Originally Posted by julie_m (Post 1370619)
My concern with the circuitry around T1/T2 is more with T1 possibly not turning off fully when the Raspberry Pi is sending a logic 1; although I decided to trust the original design, at least for the first version I tried in BCP. I did take the slight liberty of adding a Zener diode across R2.

Yes, I couldn't see how this would ensure T1 would be turned-off / there wasn't > 3.3V applied to the RPi (even at low-currents, which SiriusHardware had found still lifted the RPi's GPIO's)

If they'd used a P-Ch FET, with Vgs threshold > 5 - 3.3 = 1.7V, then that might have worked better and wouldn't get current flow from +5V rail. Vgs thresholds are rather variable, but drain current would be quite low at threshold and T2 would keep output at gnd. As long as Rds(on) is quite low at 5Vgs, then that would have worked OK.

If the design is built as shown, then might be interesting to measure what voltage levels you get in practice.

julie_m 3rd May 2021 7:49 pm

Re: Raspberry Pi as a storage device for a PET.
 
That was why I came up with a quick redesign using an LM2903. Although I'm still going with the discrete transistors for this first version.

ortek_service 3rd May 2021 8:01 pm

Re: Raspberry Pi as a storage device for a PET.
 
A partial easy-fix on the shown circuit may be to put a 4k7 etc. resistor from T1 base to emitter (or +5V), to act as a divider with R5, meaning < 3.3V would be needed at the GPIO pin to turn-on T1.

Adding another 10k etc. from GPIO pin to ground would prevent > 3.3V being sourced through resistors to GPIO pin.

(I'm wondering if they inserted R4 to prevent damage to T1 / T2, if they both got switch on together / T1 wasn't switching-off).

SiriusHardware 3rd May 2021 11:13 pm

Re: Raspberry Pi as a storage device for a PET.
 
Yes, I suppose if you think about it, there will be a brief moment, as the logic voltage transitions from 0V to 3V3 or vice-versa, when it is both low enough to turn the PNP transistor on and high enough to turn the NPN transistor on, so that resistor may be there to prevent 'shoot-through' during the transition period.

As to why the complementary pair instead of a single transistor and pullup resistor, maybe the aim was to have the output both turn on and turn off faster by having active drive high as well as active drive low.


All times are GMT. The time now is 5:33 pm.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright ©2002 - 2021, Paul Stenning.