PCDOCT
File: PCDOCT.DOC
Updated: 951211/pc, 960207/pc, 960711/pc
The PC-DOCT is a PC-AT card giving a PC the possibility to talk with seven G64 systems simultaneously.
The basic information transfer mechanism is based on the idea of a parameter.
A parameter consists of block of four 16 bit words, divided in a double word command-parameter from the PC to G64 and a double word status-parameter from G64 to the PC.
PC | PC-DOCT | G64
--------------------------------------------------------
-------- -------
| Common | -> Command -> | |
-> | Memory | -> Data -> | Hard- |
<- | Area | <- Status <- | ware |
| | <- Data <- | |
-------- -------
Seen from the PC, the parameters are transferred via a common memory area on the PC-DOCT card. The PC-DOCT processor reads command-parameters from this memory area and sends them serially to G64; this responds with the status-parameters, which are written to the common memory area.
Because the parameter transfer is done on a serial line, there will be a time delay between the writing of a command-parameter to the common memory and the update of the actual parameter in G64. This has caused the introduction of the command-written-parameter. This parameter in the common area is updated, when G64 acknowledges the receipt of a command-parameter.
Each G64 has 63 parameters (0..62) used for parameter transfer and 1 parameter (63) used for general control and status of the G64. The command part of this parameter 63 is used for enabling (Command = $FFFF) and disabling (Command <> $ffff) of the serial communication with G64. The status part shows the number of available parameters in the G64, while the status-data part shows the number of communication errors. The command-written parameter shows the potentially available number of parameters in G64. This is the same as the status parameter, if G64 is enabled. The command-data-written parameter gives the G64 ident number (ex. G805 shows 805), if it is programmed in G64. This is a new feature so most G64's won't have it.
In order to have faster access to some parameters, there is a 64 word priority list for each G64 channel. You get normal priority for a parameter if its corresponding priority word is 0. If the priority word is set between 1 and 32768, the parameter will have high priority for a corresponding number of seconds; If it is set to -1 the parameter will have high priority with no time limit. Be aware that setting high priority on 1 or more parameter will cause the refresh time of the other parameters to be slowed down with a factor of 2.
G64 data relationship: |
Disconnected G64 |
Disabled G64 |
Enabled G64 |
Command Par 63 |
|
<> $ffff |
$ffff |
Potentially available Pars. |
0 |
Updated every sec. |
Locked |
Available Pars. |
0 |
0 |
Updated |
G64 ID |
0 |
Updated every sec. |
Locked |
Status parameters |
0 |
Updated every sec. |
Updated |
Command parameters |
|
Not Updated |
Updated |
The common memory area is an I/O mapped indirectly accessed 128 kW (256 kB) RAM with the following layout (word addresses):
00000
. PC-DOCT program and stack
10000
. Presently unused
18000
. Data transfer area
1ffff
The PC-DOCT has no onboard ROM and must thus have its program loaded, before it is operational.
In order to have accurate timed fast changing voltages etc. in G64, then concept of a DAF (Digital Autonomous Functiongenerator) has been introduced. A DAF is normally connected to a parameter, which controls its slow changing behavior. Furthermore it has several DAF-tables controlling its dynamic behavior. These DAF-tables are also sent to the DAF's in G64 through the common memory.
Layout of common memory area.
Data transfer area with word address in hex:
id:
18000
... - PC-DOCT software id. and version string
18100 - Initialized status, 0 = uninitialized, AAAAh = initialized
Reset by local CPU, set to AAAAh by NT software
18101
... - unused
181ff
status parameters:
18200 - G64 channel 0 read-parameter 0 status
18201 - G64 channel 0 read-parameter 0 status-data
18202 - G64 channel 0 read-parameter 1 status
...
1827d - G64 channel 0 read-parameter 62 status-data
1827e - G64 channel 0 read-parameter 63 status = available parameters
1827f - G64 channel 0 read-parameter 63 status-data = communication errors
---
18280 - G64 channel 1 read-parameter 0 status
...
1857f - G64 channel 6 read-parameter 63 status-data = communication errors
18580
... - unused area, channel 7 is used for service communication
185ff
command written parameters:
18600 - G64 channel 0 read-command-written-parameter 0 command
18601 - G64 channel 0 read-command-written-parameter 0 command-data
...
1867d - G64 channel 0 read-command-written-parameter 62 command
1867e - G64 channel 0 read-command-written-parameter 63 command = pot.avail.pars.
1867f - G64 channel 0 read-command-written-parameter 63 command-data = G64 ID nr.
...
1897d - G64 channel 6 read-command-written-parameter 62 command-data
1897e
... - unused
189ff
command parameters:
18a00 - G64 channel 0 write-parameter 0 command
18a01 - G64 channel 0 write-parameter 0 command-data
...
18a7e - G64 channel 0 write-parameter 63 command = enable/disable communication
18a7f - G64 channel 0 write-parameter 63 command-data = unused
...
18d7e - G64 channel 63 write-parameter 63 command = enable/disable communication
18d7f
... - unused
18dff
DAF control blocks:
18e00 - DAF block 0 handshake word (= G64 channel number if active)
18e01 - DAF block 0 parameter number + 256*(table number + type)
18e02 - DAF block 0 table length
18e03 - DAF block 0 spare
18e04 - DAF block 1 handshake word
...
18eff - DAF block 63 spare
DAF data blocks:
18f00
... - DAF block 0 data
18f7f
18f80
... - DAF block 1..63 data
1aeff
Update priority block:
1af00 - G64 channel 0 parameter 0 priority
1af01 - G64 channel 0 parameter 1 priority
...
1af3f - G64 channel 0 parameter 63 priority
...
1b0bf - G64 channel 6 parameter 63 priority
1b0c0
... - unused
1b0ff
Preliminary PC_DOCT specification.
The PC_DOCT is a PC-AT card with 8 RS422 serial channels controlled by an
onboard 80186 CPU. The card is I/O mapped and occupies 8 byte addresses.
A jumper selects between interrupt 10,11,12,15 or disabled.
The base address of the card is selected with a switch with the following
correspondence between switch position and address:
pos: 0 = off
1 = $240 to $247
2 = $248 to $24F
3 = $250 to $257
4 = $258 to $25F
5 = $260 to $267
6 = $268 to $26F
7 = $270 to $277
These addresses are programmed in a PAL and are therefore subject to changes
if so required.
General handshake idea between PC and PC-DOCT CPU (hereafter called CPU).
State information is held by status register with 2 bits shared by 'client'
and 'server'. These 2 state bit codes the following information:
00 - Idle
| Transient = Client sets req.
01 - Client requests service, can give interrupt to Server
| Transient = Server sets req. ack.
11 - Server acknowledges client request
| Transient = Server resets req.
10 - Server has executed requested service, can give interrupt to Client.
| Transient = Client resets req. ack.
Both PC and CPU can function as client and server thus together requiring
4 shared state bits. This gives a status register with the 4 lowest bits
as follows:
bit 3,2 = PC Server status = CPU Client status
bit 1,0 = PC Client status = CPU Server status
Bits in the status register are set/reset individually by sending commands
to the Command register. It is possible to reset all bits in the status
registers by one command to the Command register; but normally it is only
possible to change one bit at a time.
******************* PC view *************************************************
Address map seen from PC:
| Base + 0: word/even byte Read/Write in RAM
| Base + 1: odd byte Read/Write in RAM
| Base + 2: word Read/Write in RAM, post increment addr
| Base + 2: even byte Read Status reg 1
| Base + 3: odd byte Read/Write in RAM, post increment addr
| Base + 4: even byte Read Status reg 0 / Write command
| : word Read Status reg 0 + semaphore/ Write command + semaphore
| Base + 5: odd byte Semaphore
| Base + 6: word Read/Write (word) addr register
| Base + 7: odd byte unused - part of addr register
PC Status reg. 0 layout:
|
|bit 7..5: unused
|
|bit 4: 0: Select RAM bank 0 (addr 0..1ffff = 128kb/64 kw = boot and program area).
| 1: Select RAM bank 1 (addr 20000..3ffff = shared data area).
|
|bit 3,2: Server status (= Client status in CPU status reg. 0 bit 1,0)
| 00: Idle.
| 01: CPU requests service, can give interrupt if enabled (stat. reg 1.0 and 1.2).
| 11: PC acknowledges CPU request.
| 10: PC has executed requested service.
|
|bit 1,0: Client status (= Server status in CPU status reg. 0 bit 3,2)
| 00: Idle.
| 01: PC requests service
| 11: CPU acknowledges PC request.
| 10: CPU has executed requested service, can give interrupt if enabled (stat. reg 1.1 and 1.2).
PC Status reg. 1 layout:
|
|bit 7..5: unused
|
|bit 4: CPU is running = inverted CPU reset status
|
|bit 3: CPU Hold Acknowledge
|
|bit 2: Global Interrupt enable
|
|bit 1: Enable CPU requests service interrupt
|
|bit 0: Enable CPU has executed requested service interrupt
PC Command reg. layout
|
|Special commands:
|
|1Fh = reset both status registers
|
|
|Set/reset single bits in status registers
|
|Example: Set Global interrupt enable (status reg 1, bit 2) = 11010b = 1Ah.
| ||---
|bit 7..5: unused || |
| || |
|bit 4: Set/Reset -----------------------------------------| |
| | |
|bit 3: Register 0/1 select -------------------------------- |
| |
|bit 2..0: Bit number select ------------------------------------
******************* CPU view *************************************************
Address map seen from CPU:
PCS0: Command/Status register
PCS1: DTR register (debug register)
PCS2: SIO
CPU Status reg. 0 layout:
|
|bit 4: = 0 = Status register 0 indicator
|
|bit 3,2: Client status (= Server status in PC status reg. 0 bit 3,2)
| 00: Idle.
| 01: CPU requests service
| 11: PC acknowledges CPU request.
| 10: PC has executed requested service, can give interrupt if enabled (stat. reg 1.1 and 1.2).
|
|bit 1,0: Server status (= Client status in PC status reg. 0 bit 1,0)
| 00: Idle.
| 01: PC requests service, can give interrupt if enabled (stat. reg 1.0 and 1.2).
| 11: CPU acknowledges PC request.
| 10: CPU has executed requested service.
CPU Status reg. 1 layout:
|
|bit 4: = 1 = Status register 1 indicator
|
|bit 3: undefined
|
|bit 2: undefined
|
|bit 1: Enable PC requests service interrupt
|
|bit 0: Enable PC has executed requested service interrupt
CPU Command reg. layout
|
|Special commands:
|
|1Fh = reset both status registers
|
|14h = set next read will be from status reg. 1, reset by next write
|
|Set/reset single bits in status registers
|
|Example: Set CPU has executed PC requested service =
| Change status reg 0 state x11xx to state x10xx = 00010b = 02h.
| ||---
|bit 7..5: unused || |
| || |
|bit 4: Set/Reset -----------------------------------------| |
| | |
|bit 3: Register 0/1 select -------------------------------- |
| |
|bit 2..0: Bit number select ------------------------------------
1
Last Modified 11 January 2019