USB SDK question

I am working on integrating some micro-maestros in one of our products using the .NET API . I want to be able to detect which ports have servos connected - and I think I have found a way by enabling one channel at a time as an analog input, then reading the analog input at that one channel. (You can’t enable more than one because of the mux in the microcontroller and the fact that on open channels there is a very high impedance). On channels with the servo plugged in, you can see something like 500 ADC counts because of the leakage on the servo’s input pin, and only 0-1 count if nothing is plugged in. I have working code using the USB SDK which does this, but it seems like you need to give a “reinitialize” command whenever you change the channel mode to “input” from “servo”. Is this true? Is this what the “apply changes” button does on the windows servo control software? Does this write to nonvolatile memory of the controller? I am concerned about switching between “servo” and “input” and back again for each channel every time I open communication to the controller since it may cause too many writes to the eeprom or flash and kill it over time. Is there a way to switch between servo and input without having to “reinitialize” after each switch?

The reason I want to do this is that we will possibly use multiple micro-maestros in the system (for connection reasons since they may be far apart), each with just one or two servos plugged in, and I want to identify which one I am communicating with by the servo port that the servo is connected to. Each servo will plug in to a unique channel even through there are multiple micro-maestros. So when i start up I want to find all micro-maestro devices, then identify which ones go with which servos without knowing their serial numbers before hand. The goal is to have them “plug and play” and not need to be identified or pre-configured.

Thanks,
Fred

Hello, Fred.

Yes, you need to send the “reinitialize” command to the Maestro as part of the procedure for changing a channel into an input or a servo channel. That is one of the things that the “Apply Settings” button does. The “reinitialize” command itself does not write to non-volatile memory, but the commands that you send before that command in order to actually transfer the new settings to the Maestro will write to EEPROM if you made any changes. The Maestro’s EEPROM is rated for 100,000 erase/write cycles, so it might work for your application depending on how often you establish communication with the Maestro. I think you should be able to run your procedure 50,000 times without exceeding that rating.

–David