Delta Tau GEO BRICK LV User Manual

Page of 440
Turbo PMAC User Manual 
Writing a Host Communications Program
 
405
 
• 
C.S. time remaining in move segment 
• 
C.S. time remaining in accel/decel 
• 
C.S. program execution address offset 
Addresses of Data: For details as to the exact registers used for each of these values for each motor, 
consult the Turbo PMAC Memory Map in the Software Reference Manual. 
Handshaking: Turbo PMAC will set Bit 15 of 0x067A (X:$06019E) to 0 while it is copying coordinate-
system and global data into the DPRAM, and it will set this bit to 1 as soon as it is finished.  The host 
computer should not try to read the data if this bit is 0.  If I50 is set to 0 for “on request” transfers, the 
host computer should set this bit to 0 after reading the data to indicate to Turbo PMAC that it is time to 
provide the next set of data. 
Turbo PMAC also copies the 24-bit servo-cycle counter value into 0x0678 (Y:$06019E) and Bits 0 – 7 of 
0x067A (X:$06019E) to “time-stamp” the data. 
The host computer can set Bit 15 of 0x0676 (X:$06019D) to 1 while it is reading the data.  If Turbo 
PMAC sees that this bit is 1 when it is ready to transfer more data into the DPRAM, it will skip this cycle.  
The host must be sure to set this bit to 0 when it is done reading, to permit Turbo PMAC to transfer new 
data. 
DPRAM ASCII Communications 
Turbo PMAC can perform ASCII communications through the DPRAM, as well as through the normal 
bus communications port, the main serial port, and the auxiliary serial port.  It can accept commands and 
provide responses simultaneously over multiple ports.  The DPRAM provides the fastest path for ASCII 
communications. 
Enabling: The DPRAM ASCII communications is enabled by setting I58 to 1.  If I58 is set to 0, Turbo 
PMAC will not check the DPRAM for ASCII commands. 
Sending a Command Line: To send an ASCII command line to Turbo PMAC: 
1.  Make sure that Bit 0 of the Host-Output Control Word at 0x0E9C (Y:$0603A7) – the Host Data 
Ready bit – is 0, to be sure that Turbo PMAC has read the previous command.  For the first command 
after Turbo PMAC’s power-on/reset, this bit may have to be set to 0 by the host. 
2.  Write the ASCII characters into the ASCII command buffer starting at 0x0EA0 (Y:$0603A8).  Two 
8-bit characters are packed into each 16-bit word; the first character is placed into the low byte.  
Subsequent characters are placed into consecutive higher addresses, two per 16-bit word.  (In byte 
addressing, each character is written to an address one higher than the preceding character.)  Up to 
159 characters can be sent in a single command line. 
3.  Terminate the string with the <NULL> character (byte value 0).  Do not use a carriage return to 
terminate the string, as on other ports. 
4.  Set Bit 0 of the Host-Output Control Word at 0x0E9C (Y:$0603A7) – the Host Data Ready bit – to 1 
to tell Turbo PMAC that a command string is ready for it to read.  Turbo PMAC will then read this 
command in the next background cycle, set this bit back to 0, and take the appropriate action for the 
command. 
Note that the communications routines of the PCOMM32 library do all of these actions automatically.  If 
writing a custom low-level communications routine, this operation is fundamentally a string copy operation. 
Sending a Control Character Command:  Control-character commands can be sent through the 
DPRAM through a dedicated register independent of the ASCII text commands.  To send a control-
character command to Turbo PMAC through the DPRAM: 
1.  Make sure that the control-character byte – Bits 0 – 7 of 0x0E9E (X:$0603A7) is set to 0.  For the 
first control-character command after Turbo PMAC’s power-on/reset, this byte may have to be set to 
0 by the host.