In SX Microcontrollers, SX/B Compiler and SX-Key Tool, wchahla wrote: Dear All , Iam working on the PSC but using the SX 28 MC and SX tech board. The documentation and code examples for PSC is based on BS2 MC. To communicate with the PSC and set the position of a servo the documentation states the following : [2] Syntax: "!SC" C R pw.LOWBYTE, pw.HIGHBYTE, $0D Reply: none C : is the servo channel R : is the ramping value . PW : is the position value. and the code i used is : [/2]SEROUT Sdat, Baud,["!SC", 0, 15, pw.LOWBYTE, pw.HIGHBYTE, CR] The command string is 8 byte long ending with "CR" . the Baud value is 396 corresponding to speed 2400 which is the defualt for the PSC. The code runs properly in BS2 and the servo responds to position commands. I tried to do this using SX/B and used the following code : PW VAR WORD PSC PIN RC.7 ServoCmd VAR Byte(8) idx VAR Byte Baud CON "T2400" ........ ........ ........ Start: ' initialization code here INITIALIZE_PSC_CMD Main: ' main code here TX_PSC_CMD END SUB INITIALIZE_PSC_CMD PW = 750 'Center the servo. ServoCmd(0)="!" ServoCmd(1)="S" ServoCmd(2)="C" ServoCmd(3)= 0 ServoCmd(4) = 15 'Ramping value ServoCmd(5)= PW_LSB ServoCmd(6)= PW_MSB ServoCmd(7)=13 ENDSUB SUB TX_PSC_CMD FOR idx = 0 to 7 SEROUT PSC, Baud, ServoCmd(idx) ' send the command, byte at a time NEXT ENDSUB The expected servo never responds to the command , no matter what PW value is used. Appreciate any help. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=311810 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)