Table of Contents - TG Drives

Table of Contents - TG Drives Table of Contents - TG Drives

28.11.2012 Views

164 XENDAT, EXTENDED REGISTER GROUPS result in the most significant bits being discarded to keep the total position to 32 bits. This is the preferred mode, since it allows running the encoder on lower clockfrequency, and allows interruptions in the serial data without affecting the regulation. Also any counting errors in the incremental signal will be corrected when next serial data arrives. RELATED ITEMS EXAMPLE USAGE Before the ENDAT sensor can be used, the sensor must be initialized. Example code to initialize: ; ; 1 Check that the ENDAT host interface has been initialized properly. if SYSIO.MEMSTAT and 2048 then INIT_ERR RTmp, ; Resets any spurious flags. XENDAT.Status ; ; 2 Reset interface. XENDAT.Mode, 128 ; Reset host ENDAT interface. ; ; 3 Check ENDAT power supply. ; XENDAT.Mode, 128 ; if XENDAT.Status and 4 then PWR_ERR. ; ; 4 Synchronize communication with the sensor. ; XENDAT.Mode, 32 clr tmr.t0 ; Force CLK line low. wait tmr.t0 > 100 ; This time is sensor dependent. XENDAT.Mode, 64 ; Force CLK line high. clr tmr.t0 User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001

EXTENDED REGISTER GROUPS wait tmr.t0 > 2 ; This time is sensor dependent. XENDAT.Mode, 32+64+1 ; Automatic clock mode, and enable. XENDAT, XENDAT.Clock, 4 ; 2MHz transfer rate Transfer rate is cable length dependent. ; ; 5. Ready to issue manual transfers. ; Read position, read/write parameters. GROUP MEMBERS (GROUP 56) Group.Member Member No. Range Ability Default XENDAT.Mode 0 0..255 RW 0 ENDAT.Mode = 0.The ENDAT communications not activated. b0 Serial communication interface active. b1 Analog interface active. b2 Standard encoder interface active. See the IENC group. b3 Enable ENDAT serial communication timeout interrupt See the VECTOR.PosErr member. b4 Serial data timeout has occurred. b5 Serial comm. manual mode, bit0. b6 Serial comm. manual mode, bit1. Bit 0 to Bit 6 initialize the ENDAT sensor. 00 Normal mode. 01 Force clock low. 10 Force clock high. 11 Automatic mode. After this mode is given then Normal mode is automatically entered. b7 Reset interface. When this bit is set then the ENDAT communication interface is reset. Mode values: 0 = ENDAT interface turned off. 1 = Serial mode active. User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001 165

164<br />

XENDAT,<br />

EXTENDED REGISTER GROUPS<br />

result in the most significant bits being discarded to keep the total position to 32<br />

bits.<br />

This is the preferred mode, since it allows running the encoder on lower clockfrequency,<br />

and allows interruptions in the serial data without affecting the<br />

regulation. Also any counting errors in the incremental signal will be corrected<br />

when next serial data arrives.<br />

RELATED ITEMS<br />

EXAMPLE USAGE<br />

Before the ENDAT sensor can be used, the sensor must be initialized.<br />

Example code to initialize:<br />

;<br />

; 1 Check that the ENDAT host interface has been initialized<br />

properly.<br />

if SYSIO.MEMSTAT and 2048 then INIT_ERR<br />

RTmp,<br />

; Resets any spurious flags.<br />

XENDAT.Status<br />

;<br />

; 2 Reset interface.<br />

XENDAT.Mode, 128 ; Reset host ENDAT interface.<br />

;<br />

; 3 Check ENDAT power supply.<br />

;<br />

XENDAT.Mode, 128 ; if XENDAT.Status and 4 then PWR_ERR.<br />

;<br />

; 4 Synchronize communication with the sensor.<br />

;<br />

XENDAT.Mode, 32<br />

clr tmr.t0<br />

; Force CLK line low.<br />

wait tmr.t0 > 100 ; This time is sensor dependent.<br />

XENDAT.Mode, 64 ; Force CLK line high.<br />

clr tmr.t0<br />

User's Manual 5.1 Inmotion Technologies AB<br />

Doc. No.9032 0027 01 (B), Rev. 11.07.2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!