HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post Reply
Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by Rudolf »

Hello,
I have a Logic Analyzer HP1652B with 3.5" floppy disk drive.
The system boot disk is already read in as an image file, see the attached file.
I could not upload the .hfe file, because it is 318 KB as a .zip file, allowed are 256 KB only.

When I format a new floppy disk in Windows 7 with the found values, and initialize to LIF file format,
I can copy the saved system file to this floppy disk, and in works in the HP1652B floppy drive.
So, I assume that the saved system file SYSTEM_ is correct.

When I try to analyze the floppy disk on a Windows 7 PC, I got the information,
that the rotating speed is 299 rmp, while I measured 600 rpm at the index pulse.
So I selected in the HxC software window "Load Raw Image" a Bitrate 500000.

I have added to the Gotek emulator a LCD display.
When the HP1652B boots, I can see that the track number is up counted,
then the side is changed in a second track upcount.

Afterwards the system tells, that it could not find the file SYSTEM_.

My question is, what I am doing wrong?

Regards, Rudolf

The collected data about the system disk are:
Original system disk HP1652B
Floppy disk drive Sony MP-F52W-30
Index pulse frequency on pin 8 of 34 pin connector measured = 100 ms, 600 rpm

C:\Users\klaus\Documents\fdio>Hpdir.exe -info 0:
Info: FDC sense: Windows NT/2000/XP/VISTA detected
Info: FDC sense: 82077 controller detected
Info: FDC get drives: drive 0 = DS/DD 3.5" (720k)
Info: FDC get drives: drive 1 = not installed
Info: FDC get drives: drive 2 = not installed
Info: FDC get drives: drive 3 = not installed
Info: FDC autodetect: HP1652B 3.5 DS/DD1024 found.
-- Floppy drive info --
Media type: HP1652B 3.5 DS/DD1024
Media capacity: 790 bytes
Number of cylinders: 79
Number of heads: 2
Sectors per track: 5
Sector size: 1024

Info: No valid cylinder/head/sector data in system record, using device data

-- File system info --
Image format: Logical Interchange Format (LIF) id=$1000 version=0
Image size: 808960 bytes
Volume label: "HPLIF "
Creation date & time: 00-<?>-00 00:00
Sectors per track: 5
Number of heads or surfaces: 2
Total number of user accessable tracks: 158
Total number of user accessable records: 790
System area starts at record #0
Directory starts at record #2
Directory size: 22 records
File area starts at record #24
Total number of system tracks: 5
Total number of usable data tracks: 153

4294499328 bytes of 195840 free.

C:\Users\klaus\Documents\fdio>fdio.exe -analyze a:
Using presets from fdc.ini
Analyzing disc
FDC analyze: --- testing sector geometry for side 0 ---
FDC analyze: testing modulation & data rate...OK
FDC analyze: testing sector size, start sector and sectors/track...OK
FDC analyze: testing interleave...OK
FDC analyze: testing intra-track consistancy...OK
FDC analyze: --- testing sector geometry for side 1 ---
FDC analyze: testing modulation & data rate...OK
FDC analyze: testing sector size, start sector and sectors/track...OK
FDC analyze: testing interleave...OK
FDC analyze: testing intra-track consistancy...OK
FDC analyze: --- testing track geometry ---
FDC analyze: testing cylinders...
FDC analyze: testing track integrity & media density...OK
FDC analyze: testing head skew...OK
FDC analyze: testing cylinder skew...OK
FDC analyze: testing R/W GAP3...OK

Analysis summary:
-----------------
Rotational speed: 299 RPM
Form factor: 3.5"
Track density: 135 tpi (high density)
Capacity: 808960 bytes (790k)
Data rate: 250 kbit/s
Modulation: MFM
Sector size: 1024 bytes
First sector ID: 1
Sectors total: 790
Sectors per track: 5
Cylinders: 79
Heads: 2
Interleave: 1:1
Minimum R/W GAP3: 0 bytes (22 recommended)
Format GAP3: 44 bytes (44 recommended)
Head skew: 0
Cylinder skew: 0

Errors:
- Found 1 unreadable track(s) on side 0 (maybe spares)

Recommended preset data for fdc.ini:
0x10,1,790,79,2,5,790,1,1024,2,0x16,0x2c,0xdf,1,0,0,0x40
Attachments
HP1652SY.img.zip
(236.78 KiB) Downloaded 468 times

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Jeff »

Can you send me the HFE file ?

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Rudolf »

I got it partly working. The trick was a copy protection of HP, in track 79.
The program http://simonowen.com/samdisk/ helped me. Let me explain, what I did.
A floppy disk scan shows:

Code: Select all

>samdisk.exe scan a:
83 Cyls, 2 Heads:
250Kbps MFM,  5 sectors, 1024 bytes/sector:
  0.0  1 2 3 4 5
  1.0  1 2 3 4 5
.....
 77.0  1 2 3 4 5
 78.0  1 2 3 4 5
 79.0  97 98 99 100 101
 80.0  <blank>
 81.0  <blank>
 82.0  <blank>
It is very unusual, that you have track number 97 - 101 on a floppy disk.
The data I found on track 97, side 0 and 1 are

Code: Select all

>samdisk.exe view a: -c79-79 -h0 -s97
250Kbps MFM,  5 sectors, 1024 bytes/sector:
 79.0  97 98 99 100 101

Sector 97 (1024 bytes):
0000  E6 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
0010  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
More data I found on track 98, side 0 and 1:

Code: Select all

>samdisk.exe view a: -c79-79 -h0 -s98
250Kbps MFM,  5 sectors, 1024 bytes/sector:
 79.0  97 98 99 100 101

Sector 98 (1024 bytes):
0000  50 02 88 05 03 01 02 01 A3 01 A3 E6 32 16 32 FF  P...........2.2.
0010  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
The rest of the tracks was filled with 0xFF.

The solution is to copy 80 tracks, instead of 79.

The procedure to create an .img and .hfe file is:
  • Start program HxCFloppyEmulator v2.1.4.0
    Insert your System floppy disk into the drive
    Click on button Floppy disk dump
    Then click on button Load Raw image and correct the Bitrate to 500000 and RPM to 600
    This is needed, because the real floppy disk drive turns with 600 RPM, instead of normal 300.
    Close the window with button Close
    Click on Button Export
    Save a file with file type .img (Image)
    Save once more a file with file type .hfe
    Copy the .hfe file to the USB stick and test if it works in the Gotek emulator
In order to check the Bitrate in the .hfe file you can use a Hex Editor:

Code: Select all

Addr: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Data: 48 58 43 50 49 43 46 45 00 50 02 00 F4 01 00 00 
0010: 07 01 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
typedef struct picfileformatheader_ { // Addr. Data
unsigned char HEADERSIGNATURE[8]; // 0x00: “HXCPICFE”
unsigned char formatrevision;   // 0x08 Revision 0
unsigned char number_of_track;  // 0x09: 80 tracks
unsigned char number_of_side;   // 0x0A: 2 sides
unsigned char track_encoding;   // 0x0B: MFM-IBM
unsigned short bitRate;       // 0x0C: 0x01F4 = 500 = 500000 KBit/s
unsigned short floppyRPM;  // 0x0E: 0x0000 (Not used by the emulator)
unsigned char floppyinterfacemode;  // 0x10: GENERIC_SHUGART
unsigned char dnu;  // 0x11: 0x01 Free
unsigned short track_list_offset;  // 0x12: Offset of the track list LUT in block of 512 bytes
// (Ex: 1=0x200)
unsigned char write_allowed;  // 0x14: The Floppy image is write protected ?
unsigned char single_step;     //0x15:  0xFF : Single Step – 0x00 Double Step mode
unsigned char track0s0_altencoding;  // 0x16: 0x00 : Use an alternate track_encoding for track 0 Side 0
unsigned char track0s0_encoding; // 0x17: alternate track_encoding for track 0 Side 0
unsigned char track0s1_altencoding;  // 0x18: 0x00 : Use an alternate track_encoding for track 0 Side 1
unsigned char track0s1_encoding; // 0x1A: alternate track_encoding for track 0 Side 1
}picfileformatheader;
If in address 0x0C and 0x0D you have: FA 00 (=250) change to 0xF4 0x01 (=500).

One problem I encountered while experimenting and copying data on the USB stick.
It can happen, the the LCD shows: Invalid FAT.
Then you have to format the USB stick, and copy the files again on the USB stick.
In my case:

Code: Select all

13.09.2015  18:05             8.192 HXCSDFE.CFG
27.07.2016  18:20            91.648 HXCFEUSB_HFE_V3_0_8_2a.upd
22.09.2016  08:51         2.008.064 HP1652SY.hfe
22.09.2016  09:32         2.008.064 HP1652DA.hfe
The hardware connection is:

Code: Select all

-- Gotec --                         --HP1652B (MP-F52W-30)--
?                                       Change Reset +5 V (1)
FLOPPY_DSKCHG   (2)                      Disc Change      (2)
Reserved        (4)                      In Use           (4)
Reserved        (6)                      Drive Select 3   (6)
FLOPPY_INDEX    (8)                      Index            (8)
DS0             (10)                     Drive Select 0   (10)
DS1             (12)                     Drive Select 1   (12)
DS2             (14)                     Drive Select 2   (14)
MTRON           (16)                     Motor On         (16)
FLOPPY_DIR      (18)                     Direction        (18)
FLOPPY_STEP     (20)                     Step             (20)
FLOPPY_WDATA    (22)                     Write Data       (22)
FLOPPY_WGATE    (24)                     Write Gate       (24)
FLOPPY_TRK00    (26)                     Track 00         (26)
FLOPPY_WPT      (28)                     Write Protect    (28)
FLOPPY_DATA     (30)                     Read Data        (30)
FLOPPY_SIDE     (32)                     Head Select      (32)
FLOPPY_READY    (34)                     Ready            (34)

+5V             (Power connector)        +5V              (3)
+5V             (Power connector)        +5V              (5)
GND             (Power connector)        GND              (15)
GND             (1)                      GND              (17)
So far, so good, but unfortunately the HP1652B does not recognize a disk change.
The Disk Change signal is pulled down (activ) for about 4-5 seconds if you select a different .hfe file.

If I change the floppy disk file with the Gotec front push button, the HP1652B tells me: No Disk.

This is still an open question, because I need a Data Disk to store Configuration Data,
and an Inverse Assembler for GPIB decoding.

Regards, Rudolf

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Rudolf »

I did not found a solution for the not working Disk Change function, so I have to live with one disk.

Maybe someone else could find out, how to make the Disk Change function working.

As an intermediate solution I copied the configuration files from the Data Disk
to the System Disk, named HP1652SD.hfe, attached as archiv HP1652SD.7z.

Because of a forum limitation of 256 KB for uploaded files, I had to pack
the file HP1652SD.hfe (1961 KB) with the free packer 7z.

I have seen, that when you dump the original disk and export to a .hfe file,
you have to patch with an Hex Editor the bitrate in address 0x0C and 0x0D
to 0xF4 and 0x01 (little endian) = 500 (500000 Bits per second).

For your own experiments I added also the file HP1652.img as archive HP1652.zip.

There is a configuration on the disk, that allows GPIB (HPIB or IEEE488) decoding
for State and Timing analysis, please see at http://www.rudiswiki.de/wiki9/HP1652GPIBProbe.

Regards, Rudolf
Attachments
HP1652SD.7z
(243.57 KiB) Downloaded 409 times
HP1652SD.zip
(227.45 KiB) Downloaded 476 times

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Jeff »

Have you tried to play with the interface settings into the cfg file for the disk change issue ?

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Rudolf »

Hello Jeff,
Yes, I have changed:
#define GENERIC_SHUGGART_DD_FLOPPYMODE 0x07
to
#define EMU_SHUGART_FLOPPYMODE 0x0B
but the HP1652B did also not see a DISK CHANGE.

Do you have any idea, what to do else?

Regards, Rudolf

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Rudolf »

Hello Jeff,
in order to have some solid signals to talk about, I recorded
the Signals from the 34 pin floppy disk plug:
1. Disk change, pin 2
2. Motor ON, pin 16
3. Ready, pin 34
while a disk change.
The signal Drive Select 0 was LOW all the time, in both cases.

You see at the diagram Disk_Change_Sony_FD.PNG:
1. Disk change goes LOW if the disk is removed, and
2. Disk change goes HIGH when a disk is inserted.
3. When I give the command show directory,
the motor starts and Ready goes LOW (active).
4. After that operation the motor is switched OFF, and Ready goes HIGH.
That seems logical for me.
The Sony floppy disk manual (1985) tells about the READY signal:
The line is TRUE (low) when all of the following conditions are met:
a. The drive is selected (always ON)
b. A disk is inserted. (I think, if Disk change is HIGH)
c. The Motor ON signal is TRUE (low), and
d. The index period of the motor settles within 200 ms+/- 2.5%
( I think it must be 100 ms at 600 RPM)

Your see at the diagram Disk_Change_HxC_Shugart.PNG:
1. The disk change signal is very similar to the Sony FD.
2. The motor signal is always OFF. Why?
3. The drive signals Ready LOW (active) while the disk change is not finished.
That seems not so logical for me.

I assume, that the HP1652B is confused by the HxC Ready signal,
and does not assert Motor ON.
Because it does not come, no Disk change is seen.

Before I test all the different Interface Settings, do you have in the
Interface Settings something which is similar to the Sony FD behavior?

Regards, Rudolf
Attachments
Disk_Change_Sony_FD.PNG
Disk_Change_Sony_FD.PNG (59.06 KiB) Viewed 11091 times
Disk_Change_HxC_Shugart.PNG
Disk_Change_HxC_Shugart.PNG (58.69 KiB) Viewed 11091 times

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Jeff »

I don't understand the sony chronograph : ready is coming before the motor on signal, which sound odd to me. Are you sure that the signal labels are correct ?

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Rudolf »

Jeff wrote:I don't understand the sony chronograph : ready is coming before the motor on signal, which sound odd to me. Are you sure that the signal labels are correct ?
Hello Jeff,
You are right, it was a mistake from me to swap the 2 signals.
Please see 2 new measurements, the situation did not change.
Regards, Rudolf
Attachments
Disk_Change_Sony_FD2.PNG
Disk_Change_Sony_FD2.PNG (17.26 KiB) Viewed 11063 times
Disk_Change_HxC_Shugart2.PNG
Disk_Change_HxC_Shugart2.PNG (66.58 KiB) Viewed 11063 times

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: HP1652B floppy disk drive emulator can not load SYSTEM_

Post by Jeff »

Sorry for the very long response delay, it seems that i have forgotten this thread... :oops:

Anyway after reading again the thread, i almost sure that the disk change don't work because you have used the Motor-on signal to select the emulator.
You must use the DS0 / Drive select line.

No need to open the machine to fix this, you can use the "Not Gated" firmware version available into the archive :
(With this firmware the drive is always "selected" and the drive selection line is ignored)

https://hxc2001.com/download/floppy_dri ... rmware.zip

Once updated, set interface mode to "custom" and use the Disk "nDiskChange 1" mode for the disk change pin.

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by Rudolf »

Hello Jeff,

Thank you very much for the hint.
As soon as I find time I will try that.

Regards, Rudolf

mmaciocia
Posts: 1
Joined: Mon Feb 17, 2020 2:23 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by mmaciocia »

Hi Rudolf, I am in the process of installing the HxC emulator into my HP1652b - did you ever manage to use the."Not Gated" firmware, did this solve the disk change issue?
I am guessing that you are also the person that wrote the guide at, https://www.rudiswiki.de/wiki9/HxCFloppyDiskEmulator?
Excellent information and thank-you for this!
best regards
Michael

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by Jeff »

mmaciocia wrote:
Wed Feb 19, 2020 12:44 pm
Hi Rudolf, I am in the process of installing the HxC emulator into my HP1652b - did you ever manage to use the."Not Gated" firmware, did this solve the disk change issue?
I am guessing that you are also the person that wrote the guide at, https://www.rudiswiki.de/wiki9/HxCFloppyDiskEmulator?
Excellent information and thank-you for this!
best regards
Michael
I think that the disk change issue is related to the missing reset disk change signal on the gotek (pin 1). But you can now redirect this signal on the Gotek "JTCK-SWCLK" input (PA14). Any falling edge signal on this input will clear the disk change state (The machine is expecting a rising edge signal when it assert the reset signal when a disk was changed).

Rudolf
Posts: 8
Joined: Sun Sep 18, 2016 6:42 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by Rudolf »

@Jeff
Thank you very much for the hint.
Unfortunately my HP1652B has a problem with the power supply, so I can not test it actually.

@Michael
Yes, www.rudiswiki.de is my home page.
I used the HP1652B mainly as an oscilloscope.
Because of the PSU failure I bought a cheap Hantek DSO5072.
So, I do not know If I can repair the HP1652B in the next time,
and work on that topic.

Regards, Rudolf

pruss
Posts: 1
Joined: Wed May 04, 2022 9:03 pm

Re: HP1652B floppy disk drive emulator can not load SYSTEM_ file

Post by pruss »

Has anyone in this old thread succeeded in getting the disc change to work in the end?

It occurs to me that if the Gotek firmware can't handle the disk change, one could just wire a switch to the relevant pins and send the signal manually. Less convenient, but still more convenient than swapping a floppy.

Post Reply