Phillips P2000C SASI drive

classic non-acorn hardware, software & languages
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Phillips P2000C SASI drive

Post by jonb »

Hi all, just kicking off the next thread in the P2000C series.

We start with a picture of a mysterious board.
image.jpeg
It's a SCSI-SD card adapter which may (or may not) support SASI. Certainly it works with the Sharp X68000 (SASI) so I thought I'd give it a punt...
Last edited by jonb on Mon Nov 16, 2015 7:36 pm, edited 1 time in total.
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

Some HDD interfaces for the Amstrad CPC were SASI. Visit the forum and Wiki :D

Atari ST have a ACSI HDD interface, which is SASI/SCSI like-ish, the Atari ST needs an interface to use SCSI drives. Alas these interface/converters are rare and expensive :(

And of course, old PC's used SASI before ATA/IDE drives took off.

Mark
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

I tried very hard to get a "SASI drive", but you need the controller too. It's acting as a bridge between the host's interface and a MFM HDD (I think). Can't just plug a hard drive into it. The manual talks about Xebec cards. I've never seen one for sale yet, so I have got this little device.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

So then, I have connected the card to the SASI port and configured it as follows:

Enable Parity
Enable Unit Attention
SCSI2 MODE off (SCSI-1 mode enabled)
SCSI Selection delay = auto
Startup delay 0 (seconds)

Then, under "devices", 1,2,3 and 4 enabled, all with parameters:
SCSI ID 0-3
Device Type "Hard Drive"
Sector size 256 bytes, count 40960
Device size 10Mb

I went into the Config program and added two hard drives, both 10 MB to match the settings on the card, then to UTIL.COM to format. Drive 1 and 2 are both "NOT READY" and that's as far as I have got. I can't get it to recognise the drive at all.
User avatar
george.h
Posts: 1033
Joined: Wed Apr 13, 2011 6:32 pm
Location: Chelmsford Essex
Contact:

Re: Phillips P2000C SASI drive

Post by george.h »

jonb wrote:So then, I have connected the card to the SASI port and configured it as follows:

Enable Parity
Enable Unit Attention
SCSI2 MODE off (SCSI-1 mode enabled)
SCSI Selection delay = auto
Startup delay 0 (seconds)
This is a pure guess, but try turning Unit Attention OFF (disabled).
Pic Caption: "Now now boys stop annoying your sister..."
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

No, didn't work...

User manual. A bit sparse... http://www.codesrc.com/mediawiki/index. ... UserManual
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

I am chatting with the designer via eMail. Seems like the P200C's SASI limitations (no reselection or arbitration phase) are quite common and the SCSI2SD should work with it. We discussed termination and he concluded it shouldn't be an issue the way the adapter is terminated (100/100ohm networks). He suggested altering the selection delay setting from auto to 0, 1, 10 and trying again, with/without parity. Also running it off a separate power supply to the PC's USB because the microcontroller is a bit slow and has to talk to the USB host if connected to one.

None of this is working.

I also noticed something odd with the P2K. With the adapter plugged in, it won't boot unless you enter a couple of characters on its keyboard (forced handshake?). All very odd, and may point to issues with its SASI interface.

CP/M's disk setup is configured as A, B and drive C & D as 2 5MB partitions on a shared 10MB drive (one of the options in the configuration program). SCSCI2SD is configured as four 10MB drives having 256 bytes/sector (what the P2000C expects). However, the "not ready" error in the formatter is perhaps more indicative of a hardware problem, so I will go probing round the circuit later on in the week when I have time.

Hmm, if only there was someone out there with another P2000C... :D
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

According to the timing diagram in Appendix A of this SASI spec: http://bitsavers.trailing-edge.com/pdf/ ... _Apr82.pdf..

..during the Selection phase, SEL goes Low Followed by Busy Low.

See attached scope capture. SEL seems to be active on low, and busy C/D RST are doing nothing. In the screenshot, Yellow is SEL, Cyan is Busy, Magenta is RES and Blue is C/D. The trigger is on /SEL and it is captured when I ask the P2000C to format the hard drive (so it is trying to select it).
Y=SEL, C=Busy, M=RES, B=C/D
Y=SEL, C=Busy, M=RES, B=C/D
Odd, this. At first glance, the timing diagram seems to be saying these signals are active HIGH, not LOW. On the other hand, it also says that "All signals are low true" (so active LOW is correct). Onward, then...

P2000C only outputs SEL and RES control signals (obviously D0-7!) or rather these two are the only ones you can assert with the CPU.. Therefore the others are coming from the SCSI2SD card as inputs (guessing...). If Selection is not happening there will be no response from the SCSI2SD. So next will be to see if there is anything on D0-7 (actually D0 and D1, because there are only 4 drives available on the device).

Tracing back shows that at the time of asserting the data bus it is 10 (D1 D0) which is 2 (the drive number selected in the format program).. hmm... but when I select drive 1 it still shows 2 on the data bus. hmm....
Last edited by jonb on Fri Dec 18, 2015 10:52 am, edited 1 time in total.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Scope pr0n time!
Y=/SEL, C=D0, M=D1, B=DOUT
Y=/SEL, C=D0, M=D1, B=DOUT
DOUT is the enabler for the latch that grabs the data bus for the SASI interface.

Better post a schematic too...
P200C SASI interface
P200C SASI interface
So, it asserts the data bus, sets DOUT and the data bus is latched into IC7432.

The two 74S38s look like they are being used as switches to feed the (latched) data bus values (inverted) to the SASI bus output.

Hope this makes sense to someone! Cough cough...

Meanwile, Looking upwards, it seems logical that the circuit can switch between D0-D7 and ID0/1/2/3/4/7 on the right hand side, and this input to the 74S38s seems to be doing it (or rather, enabling the data bus to show on the SASI D0-7 lines). According to the service manual ...
How the CPU operates the SASI interface, sort of..
How the CPU operates the SASI interface, sort of..
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Of course, none of this explains why:
- the data bus doesn't change when selecting between disks (maybe it is saying device 1 and disk 1/2 are partitions?)
- the timing signals are wrong (no Busy - ever; but perhaps that's because the selection bit isn't happening?)

:-k

Up to now I have suspected an issue with the hardware of the interface. Not so sure now! Advice, ideas, anyone?
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

jonb wrote:Cough cough...
You may want to see the hardware doctor about that! :lol:
Meanwhile, I still need a time machine... :roll:

I will read through, when/if I find some spare time...

Mark
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

I'd be sneezing if I'd just spent a week round the back of a couple of broken fridges! Dusty... :wink:
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Last night I read the SASI spec document.

It says you can only have 8 initiator / targets on the bus, and explains that the ID is asserted by a single line on the data bus. However, since it also shows multiple drives hanging off one target, I'm a bit confused as to how they are addressed. Must be part of the command structure.

During the SEL phase, the initiator sets its ID (bit) on the data bus, and the ID (bit) of the target it's trying to talk to. I'm now wondering which target the P2000C is trying to address and which ID it is using to identify itself.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

More observations after swapping out what looked like a faulty 74LS32.

- The P2K's util.com (HD formatter) performs the RESET phase when you select "Format Hard Drive", then asks you which drive.
- On drive selection (single key press, 1 or 2) we see the SEL signal (so it's doing the SELECT phase, I guess).
- There are two RES pulses. Not sure why. First one is ~.5uS, then 3.5uS later we see the second (~1us).

According to the timing diagram, the initiator is supposed to assert BUSY during the selection phase, but I can't see it. As I said before, there is no provision for the P2K to explicitly do this (outputs are RES and SEL and nothing else) under program control, but could IC7410 be doing it (74LS240)? I think not, because the /BUSY signal is connected to what looks like an input (pin 2 labelled 1A1 on the datasheet).
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Some more results.

Just before the SEL signal comes along, we have the 74LS373 latch (IC7432) getting a signal on its pin 11 (latch enable). It's connected to the data bus ID0-7. So I did some probing (again, triggering on SEL) and I found that
- At LE, the data bus has the value 00000001
- At SEL, the 8 outputs of the have the same value 0000001, therefore I conclude the latch is working.
- At SEL, the outputs of the two 74S38s (IC7413 and IC7411, which produce SASI D0-7) have the following values: 11111101, which look to me to be completely pants. This is what is presented on the SASI bus during the selection phase, so it's no surprise the SCSI2SD is ignoring it.

I was wondering why there is only one SASI ID here (D0 = SASI bus device ID zero) but it turns out that if the reselection phase isn't implemented (true for the P2000C), the initiator may optionally assert only one bus device ID.

This is all very odd. I expect the SASI interface has never been used before, so why the chips directly connected to it are fried is a mystery to me. It was the same with the serial port (and I expect the printer port is toasted too!).

Hey ho, back to eBay, where I discover that 74S38s are fairly expensive (how does £3.69 +99p P&P sound? EACH!! Grrrr....) :evil:
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

They are commercial suppliers with shocking handling and shipping charges? Or minimum spends?

I'm on a Kindle Fire with a titchy screen right now... Cannot read the t&cs. :(

Hmm £35 for a 7" tablet that performs well.. Bargain.
User avatar
daveejhitchins
Posts: 7878
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Phillips P2000C SASI drive

Post by daveejhitchins »

Sorry, I missed this . . . I can supply a 74LS138 for £1 including P&P.

Dave H :D
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

He's after a 74S38 :lol:

Mark
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

...and they're in the post.
User avatar
daveejhitchins
Posts: 7878
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Phillips P2000C SASI drive

Post by daveejhitchins »

1024MAK wrote:He's after a 74S38 :lol:

Mark
Should've gone to . . . Where was it :lol:

Anyway, for future they're £0.41 here.. The LS, I have were £0.17 from the same place (50 off).

Dave H :D
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Prepare for some mild cursing. "Grrrr, etc."

I was probing the wrong end of the cable, so the values I got for D0-7 on the SASI bus were not the correct ones.

I corrected that and can now see the interface setting D0 and D1 correctly. I tend to doubt that the other lines are incorrect, given that I was told the logfile shows it as 00000001 (target ID 0).

So now the question is, why is my SEL signal so short? It is about 600ns and should not be deasserted until the target asserts BUSY. The guy who designed the SCSI2SD card says it is very, very short and that it is likely the card doesn't have time to respond as a result. I had a look at the schematic but the logic for the SEL signal generation is a bit complicated and I cannot follow it.

Can anyone help me out here, please?

Edit. A thought has occurred to me. If the busy signal was coming back through the LS240 as constantly set, we might see this behavior in SEL. Makes sense?
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

No, BUSY doesn't appear to be stuck active further up the chain. Bother.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Interesting....

Running the formatter under ZSID with the Z80-ICE plugged in. I can see where it is asserting SEL in the code. If I step over the out(18),A instruction that sets SEL, I get a tiny wee pulse as before - about 600ns. However, if I do the same thing with the ICE (o 18,4) I get a much wider pulse - 9us. Annoyingly though, I am still not seeing BUSY asserted by the adapter!

Yet this is interesting. The pulse is asserted for a period under direct control of the CPU, then released automatically after a specified period. That's a mystery to me, I'd have thought we would see the CPU releasing SEL after a number of cycles. I can't see why the ICE pulse has a longer period than the formatiing utility. And don't forget, I have run the utility up to the point of SEL before cutting in with the ICE to do the OUT instruction. Of course, it's the same CPU doing both tests (mounted on the ICE).

I don't get this auto deassert step, and how it works. The interface is simple enough (although I don't fully understand it yet, but it's not like we have a specialised SASI chip doing the work). The only thing I can think of is an interrupt. Maybe there is a timer deasserting SEL automatically. But that seems very far fetched to me.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Here's the actual code that waits for SASI BUSY after asserting SEL in the HD formatting program (UTIL.COM):

Code: Select all

;SASI SEL wait routine
  0FDE  LD   A,01
  0FE0  OUT  16,A    ;SASI DataBus to 01H (selected target ID)
  0FE2  LD   A,04    ;bit 2
  0FE4  OUT  18,A    ;Assert SASI SEL
  0FE6  LD   B,00    ;255 retries
  0FE8  CALL 1075    ;Interrogate SASI status
  0FEB  BIT  3,A     ;Check bit 3 (BUSY)
  0FED  JR   NZ,05   ;BUSY detected, jump 0FF3 (return)
  0FEF  DJNZ F7      ;Decrement retry count, if not zero NOT BUSY -> 0FE8h
  0FF1  OR   FF      ;Busy not detected, set rogue value
  0FF3  RET
SASI interrogation routine

Code: Select all

 ;SASI Read control port
  1075  LD   A,90	;bit 7 set (and bit 4, not sure why)
  1077  OUT  1F,A	;FDC port: make SASI active (bit 7)
  1079  IN   A,18	;Interrogate SASI control status
  107B  RET
So, it asserts SEL once, then samples the control bus 255 times looking for BUSY before timing out. This seems correct to me - so I need to find out why SEL is deasserting so quickly.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

Back to the scope.

Here is the !SEL derivation.
Y=SEL, C=IC7409 pin 9, M=IC7409 pin 10
Y=SEL, C=IC7409 pin 9, M=IC7409 pin 10
Cyan and Magenta are connected to the inputs of the gate that generates SEL.
Cyan - Pin 9 is IOD2
Magenta - Pin 10 is the combination of !CS4 and !IOWRB

Looking at the traces, it's the CS4/IOWRB input that is causing SEL to be deasserted, but even if this was fixed, the other line (IOD2) guarantees that SEL could only ever be 2us long. If the adapter board is wanting a longer SEL event, I can't see a way of making it happen given there is no latch in play on the SEL line.
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

The designer of the card says that SEL is supposed to be held active until busy is asserted by the target. Does the following sound reasonable: Put a latch of some sort on the SEL line and clear it when BUSY is active? I'm wary of hacking up a circuit and the P2000C's PCB if I'm thinking along the wrong lines.
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Phillips P2000C SASI drive

Post by 1024MAK »

Just take the /SEL line and feed it to a resettable monostable. A monostable "times-out" (once it has been triggered) after it has been active for a time set by resistor(s) and a capacitor. Feed BUSY to it's reset input so that once the SCSI card asserts BUSY, it resets the monostable (which will then change it's output to non-active). You need the type that times regardless of the input changing state during the timing.

If needs be, stick a gate of a 74LS38 or a 74S38 on the output of the monostable.

You will need to do some research to find a suitable chip. I would help more, but I'm rather, really busy with non-retro stuff at the moment (and I have not even thought about Christmas yet...).

Good luck :wink:

Mark
User avatar
jonb
Posts: 2819
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: Phillips P2000C SASI drive

Post by jonb »

OK, thanks Mark.

I was going to ask if you could time the SEL pulse from your P2000C. Its straightforward if you have access to the board. Enter UTIL.COM, select "format hard disk" then "1" or "2" in response to the "Which drive?" prompt.

If the pulse width is more than 600ns, there is something wrong with my SASI interface.

Still, life gets in the way!

Meanwhile I am looking at the SCSI2SD source code. It's a combination of hardware spec like VHDL and application code in C. The chip is a SoC with an ARM core and a bunch of FPGA gates. I can see where it polls for SEL but I'm pretty sure it latches. Actually, it seems that both RES and SEL may be latched or buffered but I cannot be sure yet as I only just started.

Better lookup some monostables. Might need one for RES too.
Post Reply

Return to “other vintage hardware, software and languages”