AN2039 - I²C Serial Commands

I²C Serial Command Format:

Notations:

  • S = Start
  • P = Stop
  • A = Acknowledge
  • N = N
  • W = Read/Write bit

Written Commands:

S <Slave Address> W A <Command> A <Parameter> A <ValueL> A <Value H> A P

Note: Some commands will only contain a parameter and no ValueL or ValueH parameter will be sent. Typically, these are Write commands which precede a Read command.

Read Commands:

S <Slave Address> R A <ValueL> A <ValueH> N P

Command 0x10: Program Flash

Writing a 0x10 followed by a 0xAB will start a Program Flash operation. Once the user has updated all the parameters for all the modules (using the Graphical User Interface (GUI) or I²C serial instructions mentioned in this section), a Program Flash operation will permanently burn the values into the Flash memory of the PIC16F1509 device. A subsequent reset or power-up reset will retrieve values from the Flash memory. This operation is recommended after the user updates all the module parameters.

Command 0x20: Set Module Start Time Value

Writing a 0x20 command followed by the module number will set a new start time for the specified module. The two data bytes which follow this command and parameter will contain the desired Start time setting in milliseconds (ms). Since the start time is only 14-bits, the value will be limited from 1 to 16393 ms.

Command 0x24: Read Module Start Time Value

Writing a 0x24 command followed by the module number will read the start time for the specified module. A restart is then sent with a read cycle with the device Slave address to read the two data bytes. The two data bytes which follow this command and parameter will contain the desired start time setting in ms. Since the start time is only 14-bits, the value will be limited from 1 to 16393 ms.

Command 0x28: Set Module Stop Time Value

Writing a 0x24 command followed by the module number will set a new stop time for the specified module. The two data bytes which follow this command and parameter will contain the desired stop time setting in ms. Since the stop time is only 14-bits, the value will be limited from 1 to 16393 ms.

Command 0x2C: Read Module Stop Time Value

Writing a 0x2C command followed by the module number will read the stop time for the specified module. A restart is then sent with a read cycle with the device slave address, to read the two data bytes. The two data bytes which follow this command and parameter will contain the desired stop time setting in ms. Since the stop time is only 14-bits, the value will be limited from 1 to 16393 ms.

Command 0x30: Set DAC Margin Output Voltage

Writing a 0x30 command followed by the module number as the parameter will send a new margin setting for the parameter specified Pulse Width Modulation (PWM)/Digital-to-Analog Converter (DAC) channel. The two data bytes which follow this command and parameter will contain the desired PWM/DAC output setting. Since the PWM/DAC is only 8-bits, the ValueH is zero.

Command 0x38: Read DAC Margin Voltage

Writing a 0x38 command followed by the module number will setup a read of the present DAC value. A restart is then sent with a read cycle with the device Slave address, to read the two data bytes. A read will respond with the high and low value for the DAC, however since the value is only 8-bits, the high value will be zero and the low byte will contain the DAC value.

Command 0x34: Read System Retry Count

Writing a 0x34 command followed by 0x00 as the parameter will read the preset retry count parameter specified for the system. The two data bytes which follow this command and parameter will contain the retry counts. Since this value will typically be less than 10, the ValueH is ignored.

Command 0x3C: Set System Retry Count

Writing a 0x3C command followed by 0x00 as the parameter will set the preset retry count parameter specified for the system. The two data bytes which follow this command and parameter will contain the retry counts. Since this value will typically be less than 10, the ValueH is zero.

Command 0x40: Set Normal Under Voltage Limit

Writing a 0x40 followed by the module number as the parameter will send a new normal under voltage limit for that channel. The two data bytes which follow this command and parameter will contain the desired normal under voltage limit for that Analog-to-Digital Converter (ADC) Channel and apply to that power supply. This is an 8-bit value so ValueH is zero.

Command 0x50: Set Normal Over Voltage Limit

Writing a 0x50 followed by the module number as the parameter will send a new normal over voltage limit for that channel. The two data bytes which follow this command and parameter will contain the desired normal over voltage limit for that ADC Channel and apply to that power supply. This is an 8-bit value so ValueH is zero.

Command 0x60: Set Margin Under Voltage Limit

Writing a 0x60 followed by the module number as the parameter will send a new margin under voltage limit for that channel. The two data bytes which follow this command and parameter will contain the desired margin under voltage limit for that ADC Channel and apply to that power supply. This is an 8-bit value so ValueH is zero.

Command 0x70: Set Margin Over Voltage Limit

Writing a 0x70 followed by the module number as the parameter will send a new margin under voltage limit for that channel. The two data bytes which follow this command and parameter will contain the desired margin under voltage limit for that ADC Channel and apply to that power supply. This is an 8-bit value so ValueH is zero.

Command 0x80: Read Normal Under Voltage Limit

Writing a 0x80 followed by the module number as the parameter will initiate a read for the normal under voltage limit for that ADC channel. A restart is then sent with a read cycle with the device Slave address, to read the two data bytes. The two data bytes which are read will contain the present normal under voltage limit for that module. Since the value is only 8-bit, the low byte will contain the value and the high byte will be zero. The command will allow clock stretching from the Master for several ms.

Command 0x90: Read Normal Over Voltage Limit

Writing a 0x90 followed by the module number as the parameter will initiate a read for the normal over voltage limit for that ADC Channel. A restart is then sent with a read cycle with the device Slave address, to read the two data bytes. The two data bytes which are read will contain the present normal over voltage limit for that ADC channel. Since the value is only 8-bits, the low byte will contain the value and the high byte will be zero. The command will allow clock stretching from the Master for several ms.

Command 0xA0: Read Margin Under Voltage Limit

Writing a 0xA0 followed by the module number as the parameter will initiate a read for the margin under voltage limit for that ADC Channel. A restart is then sent with a read cycle with the device Slave address, to read the two data bytes. The two data bytes which are read will contain the present margin under voltage limit for that ADC Channel. Since the value is only 8-bits, the low byte will contain the value and the high byte will be zero. The command will allow clock stretching from the Master for several ms.

Command 0xB0: Read Margin Over Voltage Limit

Writing a 0xB0 followed by the module number as the parameter will initiate a read for the margin over voltage limit for that ADC Channel. A restart is then sent with a read cycle with the device slave address, to read the two data bytes. The two data bytes which are read will contain the present margin over voltage limit for that ADC channel. Since the value is only 8-bits, the low byte will contain the value and the high byte will be zero. The command will allow clock stretching from the Master for several ms.

Command 0xC0: Read Power Sequencer Status

Writing 0xC0 followed by the desired status register as the parameter will initiate a read of the desired status register. A restart is then sent with a read cycle with the device Slave address to read the two data bytes of the status register. The status registers are as follows:

Register# Value
0 Power Supply Under Voltage error bits, one for each POL
1 Power Supply Over Voltage Error bits, one for each POL
2 Fuse,<3>, Sequencer State<2>, MarginEnable,1., ON/OFF, 0> bits
3 Number of System Sequence retries since the last power ADC channel

This command will allow clock stretch from the Master for several ms.

Command 0xC8 : Clear Status Error Flags and Retry Number

A 0xC8 followed by a 0xCE will send a clear command to clear all the status bits mentioned in the 0xC0 Command execution above. Status registers 0 to 3 will all be cleared. The margin enable bit will not be cleared.

Command 0xD0: Read Module Analog Voltage

Writing a 0xD0 followed by the module number as the parameter will initiate a read for the module voltage reading. A restart is then sent with a read cycle the device slave address to read the two data bytes. The two data bytes which are read will contain the present voltage from that module voltage. Since the value is only 8-bits, the low byte will contain the value and the high byte will be zero. The command will allow clock stretching from the Master for several ms.

Command 0xE0: Power Up

Writing a 0xE0 followed by a 0xEF will start a power-up sequence. If the sequencer is already on, then this command will be ignored. This command would typically be used to restart the modules after a de-sequencing event that was triggered by an under/over voltage fault has occurred.

Command 0xF0: Power Down

Writing a 0xF0 followed by a 0xDF will start a power down sequence. This command is ignored if the controller is present in the startup or power down state. If the controller is in the ON state then this command will initiate a power down sequence.

Command Summary:

chart1.png

Status Register Bit Definitions:

chart2.png

Modx = Module x
Mrg En = Margin Enable
OV = Over Voltage
UV = Under Voltage

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.