Home Page

Siemens Simatic S5 PG 685

Posted By: rfka01

Siemens Simatic S5 PG 685 - 07/24/16 07:57 PM

This thread neatly picks up from the Siemens PC-D one, post #102220.

The Siemens PG 685 is one of the computers that was used to program the Siemens S5 automation systems.

https://en.wikipedia.org/wiki/Simatic_S5_PLC

http://www.tecmumas.de/de/computer/siemens_pg685.htm

I've got two machines, both dead, and in different states of completion. They run on PCP/M and MS-DOS, dual boot systems were common, but they aren't IBM clones/compatibles, as the bus system is different from the ISA architecture.

I was using David Gesswein's MFM reader/emulator board to transfer the harddisk images.

Some manuals and disk images are available through

http://oldcomputers.dyndns.org/public/pub/rechner/siemens/pg685/
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/24/16 08:02 PM

Machine 1 is missing the CPU card, and has a handwritten "Turbo" note on the front bezel. It might have been upgraded at some point in its lifetime as the memory cards are different from the (mostly complete) Machine 2. As it's disassembled anyway, I took the pictures of the keyboard and backplane from this one. The harddisk has sector errors when read with the MFM reader, its disk image is included for completion's sake.

PG 685 No. 1 - Backplane

PG 685 No. 1 - Bezel and Keyboard

PG 685 No. 1 - Drives and HDD controller

PG 685 No. 1 - Memory boards

PG 685 No. 1 - Harddisk image
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/24/16 08:09 PM

Machine 2 is mostly complete, but doesn't work (probably) due to a fault in its power supply. The ROM image comes off this machine, the harddisk transferred without errors.

PG 685 No. 2 - Backplane and CPU/Video card

PG 685 No. 2 - Drives and HDD controller

PG 685 No. 2 - Bezel and Keyboard

PG 685 No. 2 - Memory and Module cards

PG 685 No. 2 - Harddisk image

PG 685 ROM BIOS
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/30/16 08:31 AM

Got another one ...
Machine 3 actually turns on, but won't recognize the Testdisk I am writing to get it going. The testdisk is needed to set the NVRAM values for memory size, harddisk and probably other stuff.

The key switch plays a crucial role in this operation: Set it to >0<, insert the disk but leave the drive open, switch the machine on, close the drive door and set the key switch to "Normal" to load the test disk. Here I get "Disk defect" no matter what physical disk and test disk image combination I use. The disks have a 720K, 80 tracks, 9spt layout, so on a PC they have to be written in a 1.2MB HD drive onto DD media.



If I don't bother with the key and testdisk procedure and just press ENTER with the key in NORMAL setting, I get this test page:



I'm still not sure what the cause of the failure to load the test disk is ... maybe the floppy controller, as I've already tried swapping in a different drive.

The working power supply allowed me to test the set of boards from Machine 2, they work as well up to the configuration screen.

Machine 3 has a different CPU and video board from the other dumped machine, No. 2. It's using a 286 at 10MHz, so the handwritten "Turbo" note on the case of Machine 1 makes sense, it probably also had the 286 boards.
The monitor cable has headers for both types of boards.
The harddisk was dead as a dodo, swapping in another one didn't work yet.

PG 685 No. 3 - Backplane and CPU/Video card

PG 685 No. 3 - Bezel and Keyboard

PG 685 No. 3 - Drives and HDD controller

PG 685 No. 3 - Memory and Module cards

PG 685 ROM and CHAR BIOS, 286 ver.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/30/16 11:11 AM

I originally had wanted to include this site

http://oldcomputer.info/portables/pg685/index.htm

in the first post, but couldn't find it again ... turns out the guy switched providers just last week, and here it is again.
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 07/31/16 01:27 AM

I'm guessing either the drive is bad, or the drive you are writing data to the disks for (i.e. 5.25" drive on a kryoflux or supercardpro or dos machine running teledisk/imagedisk etc) is out of alignment.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/31/16 05:41 PM

The machine had several problems: The aforementioned keyswitch was bad, after swapping the keyboards, the machine actually shows "System Reset" if I move the key to >0<.

The drives are very finicky ... haven't had it to that extent in any other machine. To get working images, I'll have to re-write the disks I made in a PG drive on the PC in the actual machine ... thankfully the Machine 2 set of boards and harddisk started booted up with some minor fuss, so I have a working PCP/M installation ... formatting a batch of disks atm.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/31/16 05:58 PM

Getting the testdisks somewhat going revealed more about the two sets of boards, e.g. their memory map:

Machine 2, 768K RAM, V20 CPU



Machine 3, 896K RAM, 286 CPU



This one also gave away that its screen buffer sits at

E0000 - EFFFFH

It can do pixel graphics using a Hitachi 46505SP graphics chip

Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 07/31/16 05:58 PM

if you have an alignment check disk, i'd check the alignment of the drives in the machine, a classic symptom of drive being out of alignment is 'it will only read disks it itself wrote or formatted'

LN
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/31/16 06:04 PM

Yeah, unfortunately, no, I haven't got one of these. Would the Kryoflux reveal an out of whack drive?
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 07/31/16 06:09 PM

Depending on the revision of the test disk, the keyboard test uses different graphics:



vs.



The keyboard test shows these key/code combinations:

Code:
Key: Keycode/Ascii char/Ascii-Code

From top left row by row

F1: 40H//00H
F2: 41H//00H
F3: 42H//00H
F4: 43H//00H
F5: 44H//00H
F6: 45H//00H
F7: 46H//00H
F8: 47H//00H

Speicherglied: 60H//00H
Zeitglied: 61H//00H
Vergleicher: 62H//00H
Lupe: 63H//00H

COM: 53H//00H
CURS: 54H//00H
CORR: 55H//00H
+1: 56H//00H
Abbruch: 57H//00H

-][-: 48H//00H
-]/[-: 49H//00H
-T: 4AH//00H
-()-: 4BH//00H
&: 4CH//00H
>=1: 4DH//00H
-|: 4EH//00H
-o|: 4FH//00H

#: 68H//00H
Zähler: 69H//00H
FB: 6AH//00H
blank: 6BH//00H

Bildschirmmodus: 5BH//00H
x|: 5CH//00H
Netzwerk einf.: 5DH//00H
-1: 5EH//00H
HELP: 5FH//00H

1: D9H/1/31H
2: D3H/2/32H
3: D2H/3/33H
4: D0H/4/34H
5: D1H/5/35H
6: CBH/6/36H
7: CAH/7/37H
8: C8H/8/38H
9: C9H/9/39H
0: C3H/0/30H
-: C2H/-/2DH
^: C0H/^/5EH
´: C1H/\/5CH
Hardcopy: D8H//00H

Horizontal spreizen: 65H//00H
Zeichen löschen: 66H//00H
Scroll Up: 67H//00H

Ctrl
Q: DDH/Q/51H
W: D7H/W/57H
E: D6H/E/45H
R: D4H/R/52H
T: D5H/T/54H
Y: CFH/Y/59H
U: CEH/U/55H
I: CCH/I/49H
O: CDH/O/4FH
P: C7H/P/50H
@: C6H/@/40H
[: C4H/[/5BH
blank: C5H//09H
*** (<-): E0H//00H

Vertikal spreizen: 6DH//00H
Cursor up: 6EH//00H
Scroll down: 6FH//00H

SHIFT LOCK
A: E1H/A/41H
S: EBH/S/53H
D: EAH/D/44H
F: E8H/F/46H
G: E9H/G/47H
H: F3H/H/48H
J: F2H/J/4AH
K: F0H/K/4BH
L: F1H/L/4CH
;: FBH/;/3BH
:: FAH/:/3AH
]: F8H/]/5DH
ENTER: F9H//0DH

Cursor left: 75H//00H
|->->->: 76H//00H
Cursor right: 77H//00H

SHIFT
Z: EEH/Z/5AH
X: ECH/X/58H
C: EDH/C/43H
V: F6H/V/56H
B: F4H/B/42H
N: F5H/N/4EH
M: FFH/M/M4DH
,: FEH/,/2CH
.: FCH/./2EH
/: FDH///2FH
SHIFT

Cursor left single char.: 7DH//00H
Cursor down: 7EH//00H
Cursor right single char.: 7FH//00H

SPACE: F7H//20H
Funktion abschließen: 74H//00H

Left-SHIFT-Q: 9DH/Q/51H
Right-SHIFT-Q: 9DH/Q/51H
Ctrl-Q
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 07/31/16 07:09 PM

Originally Posted By rfka01
Yeah, unfortunately, no, I haven't got one of these. Would the Kryoflux reveal an out of whack drive?


No, not really frown
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 08/03/16 10:16 PM

Right, I was able to save some of the software from the harddisks ...

The machine with the V20 processor (Machine 2) has a fully functioning harddisk with a DOS partition with MS-DOS 3.3 and a PCP/M-86 partition with the S5 programming software. Using the HDPARTY utility that is available in both OS, you can change the active partition and boot alternatively.

https://www.magentacloud.de/lnk/u01ExXOQ

The HD from the third machine is completely dead, the one from the first one gave read errors on the MFM reader board, so I was surprised that it contained a readable DOS partition with GEM/3. The CP/M partition was dead, though.

https://www.magentacloud.de/lnk/fD1ERc8V

The GEM screen driver for the PG685 is SDHRC8.EGA which, according to John Elliott's GEM page, was used for Hercules Graphics as well.

http://www.seasip.info/Gem/Drivers/video.html

A lot of DOS programs that are meant for IBM compatibles send the PG 685 so far off into lala land, that even a flick of the reset switch can't get it back. The ones I tried that support Hercules were no exception.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 08/16/16 06:01 PM

The text buffer starts indeed at E0000, the examples from

https://de.wikibooks.org/wiki/Maschinensprache_i8086/_BWS_schreiben

work well if you replace the regular VGA address of B800 with the PG's E000, the text screen is 80x25 characters.

I've also seen bright and blinking text attributes.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 08/28/16 08:44 AM

John Elliott, master of all things GEM and Amstrad at http://seasip.info/ has had a VERY close look at the GEM driver that the PG685 incarnation of GEM/3 uses. He writes:

Quote:
The driver appears to support a couple of systems: the PG-685 and the PC16-11, which behave slightly differently. Both are unlike a regular PC; where on a PC you would use IN and OUT instructions to control devices, the computers this driver is aimed at have all their devices mapped into memory in the F9F0 segment. The video card is at F9F0:80h, the beeper frequency at F9F0:36h, the serial port at F9F0:38h.

The video framebuffer is either at 0E0000h or 0B0000h, depending on the value read from F9F0:85h.


He also calls the PG685's video system
Quote:
a memory mapped Hercules card.


The PC 16-11 John mentions definitely uses similar cards, and the connectors on the backplane seem to match as well.

http://merkur.dhis.org/sietusweb/Computer-Oldtimer/Personal-PC.html
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/03/16 07:08 PM

As far as I can see, the floppy controller is a WD279x at F9F0:20h. Under PCP/M-86 at least, it interrupts on INT 54h.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/03/16 08:55 PM

Great analysis, John, thanks!
Is there a way to find the address and interrupt e.g. of the harddisk controller from a running machine?
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/04/16 10:00 PM

Disassembling the BIOS ROM is probably the way to go here. I've done this with the ROM from machine 2; this suggests to me that the WD1010 is at F9F0:70h to 77h, with a separate drive/head select register at F9F0:78h and another write-only register (possibly reset or interrupt control) at F9F0:79h.

I'm not sure what interrupt it's using, but take a look at the first 1K of memory on machine 2 and see if the address FE00:0C2F appears anywhere -- that looks to me like the BIOS handler for hard drive interrupts.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/05/16 08:12 PM

John, good call for making me boot up machine 2 again. 2 and 3 are really more different than I had first realized. At least they are booting the same disks.

I'll summarize and order our findings:

Machine 2
V20 CPU, seperarate RAM board, total of 768K RAM, one EPROM containing BIOS and CHAR ROMs, HD68A45SP video chip.

Poking characters into E000 does not work, GEM complains of missing BMG (bitmap graphics). That message in the driver is there for a reason smile If you select the bmg in the testdisk and test it, the machine freezes.
John's disassembly of this machine's ROM found
- WD1010 at F9F0:70 ... 77h
- drive/head reg. at F9F0:78h
- another write only reg. at F9F0:79h
- WD279x at F9F0:20h, INT 54h (on PCP/M-86)



Using the guide at

http://www.mess.org/dumping/dump_bios_using_debug

I dumped the first 1K of memory



https://www.magentacloud.de/lnk/uh1ExtKv

FE00 sure seems busy, but I can't find 0C2F

Machine 3
286 CPU, including a total of 896K of RAM, two EPROMs for CHAR and BIOS resp., HD68A45SP video chip

GEM works, poking characters into E000 works


Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/05/16 11:01 PM

Originally Posted By rfka01
FE00 sure seems busy, but I can't find 0C2F


It is there -- INT 53h. With the floppy interrupt on INT 54h, and what looks like it might be the keyboard interrupt on INT 50h.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/05/16 11:09 PM

Hah, luvverly!
Glad the memory dump worked.
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/05/16 11:38 PM

Still on machine 2:

At FD00:000D is a 16-byte table of what looks like MC6845 registers, for a 25x80 mode with characters 11 pixels high. These values get written to a CRTC at F9F0:0002 (register select) / F9F0:0003 (register value). The corresponding text framebuffer appears to be at FB00:0000.

The INT 10h handler appears to have support for three video output possibilities:
* One as above, with the CRTC at F9F0:0002 and the framebuffer at FB00:0000.
* One with the CRTC at F9F0:0080 and the framebuffer at E000:0000 or B000:0000 [1]
* Both simultaneously

[1] To detect which to use, see code at FE00:0E1C:
MOV AX, 0F9F0h
MOVE ES, AX
OR ES:[85h], 80h
TEST ES:[85h], 2
JNZ USE_B000
MOV vid_seg, 0E000h
JMP continue

USE_B000:
MOV vid_seg, 0B000h
continue:
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/06/16 06:31 AM

Great! I'll test if machine 2 has the framebuffer at FB00:0000

Included in the DOS is an INTERN/EXTERN utility that allows the switching between ... internal and external monitor. You can also test the external monitor via the testdisk.

https://www.magentacloud.de/lnk/l0VkReo0

https://www.magentacloud.de/lnk/GD1kRnav
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 09/06/16 03:06 PM

Those magentacloud links don't work here. (some anti-adblock thing, maybe?) can you post them somewhere else, maybe on mega?

LN
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/06/16 07:14 PM

INTERN and EXTERN just emit escape sequences (ESC #x ESC [c for INTERN, ESC #y ESC [c for EXTERN) and don't touch the hardware directly.

(The actual useful code in either is about 25 bytes. The rest is unpacker code to massage the memory environment to resemble CP/M-86 rather than DOS -- I suspect the hand of Digital Research LINKEXE.)
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/06/16 09:57 PM

John, the framebuffer is indeed at FB00:0000, characters only, no attribute bytes. Again, a marked difference from machine 3.

@LN will do, once MEGA lets me login ...
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/07/16 09:29 PM

Here are the two last files on MEGA

https://mega.nz/#!ORcHWTBK

https://mega.nz/#!XUV1wKoT

If anyone's interested in specific stuff I've posted before on Magentacloud and can't reach it, please give me a shout.
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/07/16 10:16 PM

The Real Time Clock appears to be at F9F0:42h to F9F0:50h.

42h: Seconds BCD
43h: Minutes BCD
44h: Hours BCD
46h: Day BCD
47h: Month BCD
48h: 8 bytes of CMOS memory.
* 4Ah may be floppy drive types (bits 0-2 drive A, bits 3-5 drive B).
* 4Bh may be similar drive types for hard drives
* 4Ch holds BCD year.
* Low 3 bits of 4Dh appear to be memory size.
50h: Busy flag (before reading RTC, wait until this is not 1).
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/07/16 10:39 PM

Keyboard is handled by a NEC 8279C-2.

F9F0:0000h is scancode
F9F0:0001h is FIFO status (on read) / command (on write)

The PCP/M-86 keyboard handling code also checks a couple of bits read from F9F0:0004h, but I don't know why yet.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/07/16 11:08 PM

John, could that be the key switch?

There's also the module programmer, a port called SINECH1, a printer port and one labelled AG-S5. I can't test those for lack of peripherals and documentation.
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/08/16 11:18 PM

Going by CCP/M-86 and the BIOS, the printer port works as follows:

F9F0:0033h: This is read before output. If value & 0x70 == 0x70, output thrown away (printer not present?)
F9F0:0032h: Initialised to 1Dh at startup, not subsequently touched.
F9F0:0031h: Status read. If bit 7 or 0 is set, port is busy; wait until these bits go to 0.
F9F0:0030h: Data output.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/13/16 05:07 PM

The PG685 with the V20 (machine 2) has one physical ROM that contains the character generator ROM for the 6845 and the BIOS. How is that reflected in MAME's ROM loading? Does the driver need to load the same file twice?
Posted By: Edstrom

Re: Siemens Simatic S5 PG 685 - 09/13/16 06:54 PM

I have the same "problem" for the KRON K180 driver, right now I have just divided the physical rom into three AM areas and set a name "chargen" to the one in the middle. I'd like to know of alternative/better ways to to do this.

There is physical circuitry that will steal cycles from the main cpu to access this area but I don't know exactly how yet. Guess the 6845 does something similar?
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 09/13/16 06:57 PM

Just have your 6845 (or whatever) draw callback read from the same region that the CPU uses. There's no requirement in MAME that other things can't access that region.
Posted By: John Elliott

Re: Siemens Simatic S5 PG 685 - 09/13/16 08:45 PM

In the case of Machine 2, I suspect the 6845 actually reads the character bitmaps from RAM at FA00:0000. There's code in the BIOS ROM at FE00:1AE9 that copies 2k of data from FC00:0000 to FA00:0000.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/13/16 10:04 PM

So judging from this RAM test on machine 2 ...



would this memory map sound reasonable?

Code:
static ADDRESS_MAP_START(pg685v10_mem, AS_PROGRAM, 16, pg685v10_state)
	ADDRESS_MAP_UNMAP_HIGH
	AM_RANGE(0x00000,0xbffff) AM_RAM
	AM_RANGE(0xf0000,0xf1fff) AM_RAM
	AM_RANGE(0xfa000,0xfc000) AM_RAM AM_REGION ("charcopy", 0)
	AM_RANGE(0xfc000,0xfffff) AM_ROM AM_REGION("bios", 0)
ADDRESS_MAP_END
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 09/13/16 10:36 PM

You have one mistake:
Code:
AM_RANGE(0xfa000,0xfc000) AM_RAM AM_REGION ("charcopy", 0)

should be
Code:
AM_RANGE(0xfa000,0xfbfff) AM_RAM AM_REGION ("charcopy", 0)


I'm wondering if the f0000-f1fff range isn't mirrored 6 times over the whole f0000-fbfff range, including the charcopy region;
If that was the case, the memory map would be:
Code:
static ADDRESS_MAP_START(pg685v10_mem, AS_PROGRAM, 16, pg685v10_state)
	ADDRESS_MAP_UNMAP_HIGH
	AM_RANGE(0x00000,0xbffff) AM_RAM
	AM_RANGE(0xf0000,0xf1fff) AM_RAM AM_MIRROR(0x06000) AM_REGION ("charcopy", 0)
	AM_RANGE(0xf8000,0xf9fff) AM_RAM AM_MIRROR(0x02000) AM_REGION ("charcopy", 0)
	AM_RANGE(0xfc000,0xfffff) AM_ROM AM_REGION("bios", 0)
ADDRESS_MAP_END


That's just speculation, though. You'd need to test by using debug or a similar program to write to f0000 and seeing if the same written data shows up at f2000 f4000 f6000 f8000 fa000 etc.

LN
Posted By: crazyc

Re: Siemens Simatic S5 PG 685 - 09/13/16 10:40 PM

Does AM_RAM and AM_REGION work combined like that?
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 09/14/16 12:32 AM

No. You need to use AM_SHARE for what he's trying to do.
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 09/14/16 06:15 AM

crap, I knew it was something like that. Anyway, I think there's examples of AM_SHARE with offset set to 0 to remap areas of memory on top of each other like that.

LN
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/14/16 08:55 AM

Right,
Code:
static ADDRESS_MAP_START(pg685v10_mem, AS_PROGRAM, 16, pg685v10_state)
	ADDRESS_MAP_UNMAP_HIGH
	AM_RANGE(0x00000,0xbffff) AM_RAM
	AM_RANGE(0xf0000,0xf1fff) AM_RAM
	AM_RANGE(0xfa000,0xfa7ff) AM_RAM AM_SHARE ("charcopy")
	AM_RANGE(0xfb000,0xfb7ff) AM_RAM AM_SHARE ("framebuffer")
	AM_RANGE(0xfc000,0xfffff) AM_ROM AM_REGION("bios", 0)
ADDRESS_MAP_END


is the first revision ... will things like 6845 registers, HD and Floppy addresses go into
Code:
static ADDRESS_MAP_START(pg685v10_io, AS_IO, 16, pg685v10_state )
as they're memory mapped rather than io?

Thanks for walking me through this, even if I only understand half of what I'm doing smile
Posted By: Duke

Re: Siemens Simatic S5 PG 685 - 09/14/16 09:22 AM

If they're memory mapped they need to go into AS_PROGRAM.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/14/16 09:46 AM

Thanks Duke, I'll look for examples to compare.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 09/16/16 06:08 AM

I've incorportated all of the addresses John found out into the program memory map.

Code:
static ADDRESS_MAP_START(pg685v10_mem, AS_PROGRAM, 16, pg685v10_state)
	ADDRESS_MAP_UNMAP_HIGH
	AM_RANGE(0x00000,0xbffff) AM_RAM
	AM_RANGE(0xf0000,0xf1fff) AM_RAM
	AM_RANGE(0xf9f00,0xf9f00) // Keyboard scancode
	AM_RANGE(0xf9f01,0xf9f01) // Keyboard status (read) Keyboard command (write)
	AM_RANGE(0xf9f02,0xf9f02) // 6845 Register select
	AM_RANGE(0xf9f03,0xf9f03) // 6845 Register value
	AM_RANGE(0xf9f04,0xf9f04) // PCP/M-86 keyboard handling code also checks a couple of bits read
	AM_RANGE(0xf9f20,0xf9f20) // WD 279x floppy controller
	AM_RANGE(0xf9f30,0xf9f30) // Printer data
	AM_RANGE(0xf9f31,0xf9f31) // Printer status read
	AM_RANGE(0xf9f33,0xf9f33) // Printer present?
	AM_RANGE(0xf9f42,0xf9f47) // RTC registers
	AM_RANGE(0xf9f48,0xf9f4c) // NVRAM
	AM_RANGE(0xf9f50,0xf9f50) // RTC Busy flag
	AM_RANGE(0xf9f70,0xf9f77) // WD 1010
	AM_RANGE(0xf9f78,0xf9f78) // WD 1010 separate drive/head select register
	AM_RANGE(0xf9f79,0xf9f79) // another write-only register (possibly reset or interrupt control)
	AM_RANGE(0xfa000,0xfa7ff) AM_RAM AM_SHARE ("charcopy")
	AM_RANGE(0xfb000,0xfb7ff) AM_RAM AM_SHARE ("framebuffer")
	AM_RANGE(0xfc000,0xfffff) AM_ROM AM_REGION("bios", 0)
ADDRESS_MAP_END


If that looks reasonable, I'll try to find out how to talk to those memory regions (devices, nvram et al.)
Posted By: Olivier Galibert

Re: Siemens Simatic S5 PG 685 - 09/16/16 08:48 AM

Beware that since the bus is 16-bits wide, all start addresses must be even and all end addresses must be odd.

OG.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/03/16 10:06 PM

New addition to the PG family:



The PG 675 sports two floppy drives instead of a Floppy and harddisk instead as in the PG 685.

The drives are Teac FD-55BV-11-U which should make them 40 tracks/side instead of the 80 tracks/side drives of the PG 685.

If you switch the PG 675 on, it asks for a disk.



Unfortunately I don't have a bootdisk yet.

The archive contains photos and a dump of the BIOS ROM.

https://www.magentacloud.de/lnk/gx1kRKc0
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 11/07/16 02:35 AM

Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 11/07/16 03:14 AM

Committed that along with some fixes so oua12 boots. Couldn't figure out the chargen decode for oua12, so the characters are wrong, but you can easily make out the arrow smile

ETA: also added the pg675 set and hooked up the MM58167 RTC. The behavior here isn't quite right, I'll have to dig up the 58167 manual again and fix that emulation.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/07/16 10:06 AM

RB, thanks a lot!

I put the working power supply in the OUA12 ... it's a bit of a hassle to swap them.

The "arrow" screen on the OUA12 is asterisks as with the other machines.



The 675 will dump you sometimes into some primitive monitor if you have a disk in it (mind you, I've yet to source the matching disks for it, so it does only attempt to boot).
Either the NVRAM batteries have now run completely flat, or I've overwritten something, if you compare the start screen that I've posted a few days ago to the pic taken today, the numbers on top are now all zeros.

Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/07/16 10:42 AM

This is the monitor I was talking about in the last post.



The disk that gets you there is one particular copy of the rev. A08 testdisk for the PG685 ... I don't know what that 96tpi floppy triggers in the 48tpi drive.

https://www.magentacloud.de/lnk/5IVERGPl
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/23/16 09:55 PM

AJR, thanks for the work on the Siemens PG driver - there's finally a boot disk for the PG 675 en route to me, I'll make it available as soon as possible.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/26/16 03:11 PM

Siemens PG 675 boot disk - the label says "S5 Betriebssystem", i.e. operating system.
I can't get beyond the settings screen, but it's the only disk I have found so far that boots.

https://www.magentacloud.de/lnk/ZLVkx51L
Posted By: Lord Nightmare

Re: Siemens Simatic S5 PG 685 - 11/27/16 05:08 AM

Can you post that somewhere else? magentacloud is one of those providers where you need to disable all ad blocking and enable random scripts to run on your browser to get at the files.

Can you put it on sendspace or dropbox or google drive instead?
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 11/27/16 09:07 AM

Sorry forgot ... try

http://oldcomputers.dyndns.org/public/pub/rechner/siemens/pg675/image/pg675.td0
Posted By: AJR

Re: Siemens Simatic S5 PG 685 - 12/07/16 01:18 AM

I don't think I can contribute any more to this driver until a hard disk image gets hooked up to the PG685's WD controller by someone who knows better than me how to emulate these things in MAME. That way, we can get closer to the ROM's keyboard test, and I have a fair concept of what the key matrix should look like (though the 8279's CNTL line is most definitely not hooked up to any sort of modifier key...)
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/07/16 07:22 AM

AJR maybe the 675 is lower hanging fruit as it's only got floppy drives.

Two versions of the test disk and one different version of the boot/program disk are just in:

http://oldcomputers.dyndns.org/public/pub/rechner/siemens/pg675/image/index.html
Posted By: AJR

Re: Siemens Simatic S5 PG 685 - 12/07/16 09:23 PM

Well, I don't really know about hooking up FDDs any better, and the PG675 also doesn't have any self-test routines in ROM.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/08/16 12:30 AM

I tried to find a driver that was similar enough to copy stuff over from, but while I can roughly tell what goes where in a MAME driver, I don't know enough about the gory details hardware and softwareside to make it work.
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 12/08/16 01:54 AM

The FDC is standard, right? I can maybe take a look at it.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/08/16 07:41 AM

RB, that would be great. 675 and both 685 variants have Siemens SAB 1797 floppy controllers on their module boards. At least on the 685 I/O is memory mapped.

John Elliott has identified some of the addresses used, his findings are listed in the skeleton driver.

For the 675 it's two 5.25" DS/DD 40 track drives, for the 685 one 5.25" DS/QD 80 track drive and a 12 / 25 / 51 MB Winchester.

The combinations I've encountered here are

OUA11: WD2010B-AL controller chip / Miniscribe 8425
OUA12: WD1010A-AL controller chip / Tandon TM262

Thanks!
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/10/16 10:39 PM

I've created a pull request for the PG machines ... the drives are in place, the floppy controller is changed to the FD1797 that is found on the boards.
I hope RB can make the necessary connections smile
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 12/17/16 03:20 AM

Are there schematics or technical manuals for any of these?
Posted By: AJR

Re: Siemens Simatic S5 PG 685 - 12/17/16 03:56 AM

Schematics would be wonderful to have here, but they probably don't exist; I doubt that Siemens intended for any third-party software to be developed for these specialized computers.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/17/16 09:45 AM

@RB ... no schematics, unfortunately. No hardware description, even. Those machines were only supposed the programming suite for the S5 controllers.

I can only offer the hardware manual for the Siemens Sicomp PC16-11, a desktop machine that might or might not share DNA with the Simatics.
Per John Elliot's analysis, the GEM driver contains the names of both the PG685 and the PC16-11. In that case, it's the OUA12 variant.

PC16-11 hardware manual compact

Around p.35 there's a detailed address list, a bit about how interrupts work on the PC16-11 and some rough diagrams. If you see anything that might help and need a translation, give me a shout.
Posted By: AJR

Re: Siemens Simatic S5 PG 685 - 12/17/16 01:04 PM

R. Belmont, in the Shout Box:

Quote:

I'm trying to figure out what's up with the floppy on the pg675 and the ROM code is unusually hard to read. bad compiler or something I assume.


What's slightly perverse about the PG675 ROM code is that the I/O base addresses, rather than being loaded straightforwardly as on the PG685, are stored in a descriptor table that is part of a large block copied from ROM into RAM, with LES used to put the descriptors into registers. (Just to make matters even more confusing, NEC's assembler doesn't have a specific name for the LES instruction, making it just a MOV with two operands.) One result is that 0F9F0h:20h (the FDC register base) gets loaded into ES:BX from 0h:49Fh.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/18/16 03:50 PM

There are disassemblies of two PG685 PCP/M-86 versions on Gaby's Z80 site:

http://www.cpm.z80.de/source.html
Posted By: AJR

Re: Siemens Simatic S5 PG 685 - 12/18/16 06:05 PM

I've read the Sicomp PC16-11 manual, and some of the subsystems described there look nearly identical to what the PG685 is known to have. Particularly promising are the descriptions of the display RAM, the PIT gates and the extra HDC registers. The separate read and write system registers at F9F04h are more or less similar. The PC16-11 also has an external FDC register, but the way it's described doesn't match what the PG685 writes to (the address is different, too). The PC16-11's serial keyboard is very different from the 8279-driven one the PG675 and PG685 use, and its interrupt system has very little in common with them.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 12/18/16 09:59 PM

I'm hoping to get access to a PC16-11 next year and will try to document it and dump its ROMs.
Posted By: R. Belmont

Re: Siemens Simatic S5 PG 685 - 12/18/16 10:44 PM

The disassemblies aren't commented in any way, and the addresses don't line up with the ROM code, so that's not too helpful unfortunately.
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 01/24/17 05:41 PM

Looks like there WAS more than just the S5 programming software for the PG-675 ...

PCP/M-86 for Simatic PG-675
Posted By: rfka01

Re: Siemens Simatic S5 PG 685 - 10/26/17 04:42 PM

Another member of the Siemens Simatic S5 family, clearly more recent than the other three, and on its way to a "field programming device" as they were called later.

[Linked Image]

Dumping this machine would not have been possible without TeamE's invaluable service. He unsoldered and dumped one of the chips which I wouldn't have tackled myself and documented the machine while he was at it. Thanks!

[Linked Image]

Two 720K disk drives, NEC V20 CPU, 512K RAM, 80x25 LCD screen

Later an upgrade was available:

"6ES5 635-OU.1. PG 635 programmer
6ES5 635-3SA.1 PG 635 upgrading kit

A new and more powerful version of the PG 635 programmer is
now available. This new PG 635 II offers the following features:
- One 40 Mbyte hard disk and one 3.5" floppy disk drive.
- Working memory increased from 512 Kbytes to 640 Kbytes.
- A Centronics interface for printers."

The software I have claims to be from an upgraded machine but is supposed to boot on the original as well. Unfortunately my disk drives both seem to be dead. Files on the FTP and here:

Siemens Simatic S5 PG 635
© 2020 Forums