Nathan at Basic Micro is the only one who can help with this. The code he originally wrote was using an old version of the new Pro IDE. I have no idea if it will still work with the changes he has implemented in the new IDE. [email protected]
Hi Jim,
Thank you for taking the time to speak with me yesterday.
I’ve read this post as you suggested and garnered the following understanding:
-
Programming Hitec Digital Servos requires a programmable computer/micro controller that is capable of serial I/O at 19.2K baud, 8-bits, 1 stop bit, no parity.
-
A hardware interface is required that multiplexes the serial data stream into and out of the servo’s signal line. The Hitec Digital Servo document details this interface for a PC. The Basic Atom Pro (BAP) code sample you referenced sets the BAP’s P0 and P14 port characteristics so that they act as a multiplexor for serial I/O to the servo.
-
The BAP code sample you referenced sets the BAP up to program a specific set of values that extends the servo’s range of operation from the factory default to a full ±90 degrees. The values used in the program have been extracted from a servo after it was set up using the Hitec HFP-10 Digital Servo Programmer.
Does this track with your understanding?
Hi,
The information in the servo document was gained from snooping the interaction between the HFP-10 and the digtal servos. Therefore it should be good for any servo which the HFP-10 can program. The 5645 is OK for this. I didn’t try any of the new G2 servos or the HFP-20.
The serial interface is as you describe and logically inverted at TTL level, so compatible with most UARTs directly. The TX and RX are on the same control lead, so you need to able to tristate the TX.
I controlled the power to the servo for the PC version. This because the servo tests for the programmer at power up. You can get around this by plugging in or powering up the servo at the right time.
The values used to set the range were based on values read from a number of HFP-10 to servo setups. The values do change slightly, so I guess some algorithm is used based on the checking of the servo endpoints. However the average values given do seem to do the job nicely.
It’s a long time since I last looked at this, but let me know if you have problems. If you discover more please share.
Hi Ribbotson,
In your original “Programming Hitec Digital Servos” you refer to VisualBasic 2005 source code being available for driving the hardware described. Is this still available?
Thanks,
Murray
I’ve attempted to use a Basic Atom Pro running a modified version of serpro01 to communicate with a HiTec HS-5125 Thin Wing Digital Servo. I’ve set up the circuit on a Basic Atom Prototype board using the serpro01 recommended 90 kOhm pull down on the signal line and 220uF of capacitance on the power rails. In addition I have a HiTec HFP-20 Digital Servo Programmer and a Basic Stamp Logic Analyzer (BSAL) that I have used to check that the servo is fully functional. I’ve also used the BSAL to watch various signals from the Pro and the servo. I can clearly see the initial handshake signal coming from the servo. However, the pro never exits it’s initial test loop. I have used the pro to toggle the signal line although not with the right timing to communicate with the servo. From what I can tell this is because the servo won’t pull the signal line high enough to register as a “1” that allows it to exit the initial test loop. I have tried varying the pull down value between 47k and the recommended 90k without success. Using the pro AD converter the max value I get from the servo is around 2.3 volts.
I’m starting to think that I need to isolate the servo with level shifting circuitry something like used by lynxmotion forum member ribbotson here:
basicmicro.com/downloads/doc … 0Servo.pdf
Am I missing something? I’m using the latest pro IDE.
I don’t know much about the Hitec programming format or the electrical requirements. The AtomPro can not drive heavy loads directly which could cause the high output to be clipped lower than 5v. If you are using P6 or P7 to try talking to the servo your high will be only 3.3v or less as well.
The Pro’s P0 signal line in input mode is used to detect the servo’s handshake start bit and then the serpro01 code enables the interrupt that allows the hardware UART on the Pro’s P14 signal line to read the serial data from the servo. The serpro01 code never gets this far because the servo doesn’t seem able to swing the signal line high enough (greater than 2.5 volts) to be interpreted by the Pro as a logical true or “1” when connected direcly to the Pro and conditioned with a 90 Kohm pull down.
In his PC serial port based circuit ribbotson buffers the inputs and outputs to the PC serial port using MOSFET transistors. I’m thinking that I’ll need to do this with the Pro also.
Hi voxelman,
I know this used to work with a standard Atom Pro I/O pin. I wish I had kept better notes. Sorry I’m no help.
I intend to keep digging at it because otherwise I will have to manually program 60+servos.