OpenServo Commands
The OpenServo implements the following commands that can be sent by the master controller to enable certain operations of the servo. These commands are sent to the OpenServo using the TWI-bus COMMAND cycle.
NOTE: Please refer to the 'twi.h' file for specific definitions of each command.
Reset
8 bit command
0x80 |
RESET |
Reset microcontroller |
Reset the OpenServo. This will reboot into the bootloader, and after timeout the OpenServo application.
RESET = 0x80 [device RESET] send [0x10 0x80]
Enable and disable the PWM
8 bit command
0x82 |
PWM_ENABLE |
Enable PWM to motors |
0x83 |
PWM_DISABLE |
Disable PWM to servo motors |
Enable and disable the PWM module on the OpenServo. When PWM is disabled, there will be no current going to the motor, and the horn will slacken.
PWM_ENABLE = 0x82 [device PWM_ENABLE] send [0x10 0x82]
Enable and disable writing to protected registers
8 bit command
0x84 |
WRITE_ENABLE |
Enable write of read/write protected registers |
0x85 |
WRITE_DISABLE |
Disable write of read/write protected registers |
In order to write any data to the protected registers you must first enable them for writing.
WRITE_ENABLE = 0x84 [device WRITE_ENABLE] send [0x10 0x84]
Save, restore and default the saved registers
8 bit command
0x86 |
REGISTERS_SAVE |
Save read/write protected registers fo EEPROM |
0x87 |
REGISTERS_RESTORE |
Restore read/write protected registers from EEPROM |
0x88 |
REGISTERS_DEFAULT |
Restore read/write protected registers to defaults |
REGISTERS_SAVE Saves the current read/write settings to the OpenServo EEPROM. They are then protected across a reboot. REGISTERS_RESTORE Restores the saved EEPROM settings to the current running OpenServo. REGISTERS_DEFAULT restores the default hard programmed servo options.
REGISTERS_SAVE = 0x86 [device REGISTERS_SAVE] send [0x10 0x86]
Erase the EEPROM
8 bit command
0x89 |
EEPROM_ERASE |
Erase the AVR EEPROM |
Erases the current EEPROM from beginning to end. Restore to defaults after this.
EEPROM_ERASE = 0x89 [device EEPROM_ERASE] send [0x10 0x89]
Request a new voltage sample
8 bit command
0x90 |
VOLTAGE_READ |
Request a new Voltage sample |
This sets the voltage sample flag inside the OpenServo. You trigger this command before the VOLTAGE_HI and VOLTAGE_LO registers are filled.
VOLTAGE_READ = 0x90 [device VOLTAGE_READ] send [0x10 0x90]
