0% found this document useful (0 votes)
130 views16 pages

dm00682242 The Stpmic1 Ic Programming Guide Stmicroelectronics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views16 pages

dm00682242 The Stpmic1 Ic Programming Guide Stmicroelectronics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

AN5440

Application note

The STPMIC1 I²C programming guide

Introduction
This application note provides a detailed description of the programming function of the STPMIC1. It also describes the minimal
system requirements and instructions to program the NVM for a selected power-up configuration. All examples assume that the
customer uses any silicon review and has a base- knowledge of BUS I2C programming.

Figure 1. STEVAL-PMIC1x

AN5440 - Rev 1 - February 2020 www.st.com


For further information contact your local STMicroelectronics sales office.
AN5440
General considerations

1 General considerations

This section provides some detailed information about the STPMIC1 (re)program stand-alone function. It outlines
the system requirements and the instructions needed to (re)program the NVM content for a selected power-up
configuration.
The STPMIC1 has a non-volatile memory (NVM) that stores essential settings, which are applied to each startup
of the device. Programmability of the NVM allows the STPMIC1 to be fit to different use cases. User accessible
NVM content is:
- Default output voltages
- Power-up/down sequence
- Protection behavior
- I2C slave device address
- Auto turn-on and other various features (see the STPMIC1 datasheet for further details)
Three standard NVM configurations are available from the manufacturing company: the STPMIC1A, STPMIC1B
and STPMIC1C. The STPMIC1C is turned ON after applying the input voltage, but all output voltages are not
turned ON with Rank0 by default. To facilitate mass production, each of them can be re-programmed by I2C
directly into the target application. The procedure is being described below.
To access the I2C interface of the STPMIC1, a simple standard I2C, a USB adapter connected to the PC and a
terminal emulation software (Hyper Terminal, PuTTY, RealTerm, etc…) are enough.
The communication is still present even if the device is in stand-by mode or OFF mode and VIO voltage is
provided.
In this document, some examples of this procedure are described, using our USBSTICK I2C to a USB adapter
and the dedicated STPMIC1 GUI, directly addressing the registers and changing their content (using the general
tab or a dedicated tab of the GUI program).

Figure 2. USBSTICK – I2C to USB interface

AN5440 - Rev 1 page 2/16


AN5440
Hardware considerations

Figure 3. ST GUI interface

1.1 Hardware considerations


The minimum system requirements to program the NVM content are:
- An I2C communication interface to communicate with the STPMIC1
- A power supply providing 3.8 V for VIN and 3.3 V for VIO pins
- All GND pins connected to ground

Figure 4. Minimum system requirements

AN5440 - Rev 1 page 3/16


AN5440
Programming steps

In the final customer application, VIN, VIO and I2C BUS communication must be isolated by using solder shorts or
0 Ω resistors to switch between external programmer or the onboard micro-processor. However, minor rework of
the board is required once the NVM content is (re)programmed. Better, but more expensive if compared with the
solder shorts or 0 Ω resistor, is the use of a switch to isolate the I2C BUS.

Figure 5. I2C BUS

SCL
SCL
Processor

STPMIC1

SCL Programmer

SDA Processor
SDA STPMIC1
SDAProgrammer

Processor/Programmer
SELECT

In the STPMIC1x demo board, the VIN, I2C BUS and VIO_EXT connectors are available, but you need to set the
J2 to use the header H16 to supply 3.3 VIO externally.

1.2 Programming steps


The following steps are valid for the all system requirements already described:
- Turn ON the power supply at 3.8 VIN 100 mA and 3.3 V 100 mA for VIO
- Generic I2C to USB converter (VCP) or the USBSTICK using ST GUI
- Check the I2C communication by read the default device address at 0xFF = 0x33
(I2C_ADDR[6:0]: ‘0110011’)
- Change the NVM shadow register values according to the customer application needs, see the
STPMIC1 datasheet for more details
- Transfer the new NVM shadow register values to the NVM content by starting the “NVM write
operation” using the address 0xB9 and write the value 0x01 (NVM_CMD[1:0] = ‘01’)
- Done, new configuration is available in the next power-up cycle

AN5440 - Rev 1 page 4/16


AN5440
Example 1: how to change I2C device address

1.3 Example 1: how to change I2C device address


The default device address, of the STPMIC1, is 0x33. If the application needs a different value, it can be changed
as described below.
It is very important to consider that the device address is changed instantly after writing procedure and a change
of the settings of terminal/software is needed to properly communicate with the STPMIC1 (this programming
behavior is valid for the I2C device address only).

1.3.1 GUI use


For this example, the "General" of the GUI is used.

Figure 6. General tab

The figure above shows on the left side I2C settings, 0x33 (7bit) device address and the communication speed.
By clicking the "Read" button with the register 0xFF selected (you can omit 0x) and put FF on register address
window, its content is shown on "Data" field, 33 (0x33) the default device address. A new value: 34 (0x34) is now
entered in the "Data" field, then click "Write" button. The new address is applied immediately, so to further
communicate by the GUI, the I2C settings need to be updated with the new address value 34 otherwise an I2C
communication error is sent. See figures below.

Figure 7. I2C settings

Figure 8. I2C settings with new address value 34

1.3.2 Command line use


For a standard terminal emulator (like PuTTY, RealTerm, etc…) the following read/write command syntax has to
be used after setting the hardware interface (Com port, Baud speed, Parity and Data Bits):

AN5440 - Rev 1 page 5/16


AN5440
Example 1: how to change I2C device address

i2cget -y 0 <DEVICE ADDRESS> <ADDRESS> (read)

-y skip the prompt for confirmation from the i2cget command


0 the I2C bus to use, denoted as bus 0
<DEVICE ADDRESS> the address of the slave device, [0x33]
<REGISTER> the register on the slave to read from, [0xFF]

i2cset -y 0 <DEVICE ADDRESS> <ADDRESS> <VALUE> (write)

-y skip the prompt for confirmation from the i2cget command


0 the I2C bus to use, denoted as bus 0
<DEVICE ADDRESS> the address of the slave device, [0x33]
<REGISTER> the register on the slave to write to, [0xFF]
<VALUE> the value to write, [0x34]

Below, step by step, an example on how to change the device address from 0x33 to 0x34
- i2cget -y 0 0x33 0xFF to 0x33 (read address value)
- i2cset -y 0 0x33 0xFF 0x34 (write new address value)
- i2cget -y 0 0x34 0xFF to 0x34 (read new address value)
- i2cset -y 0 0x34 0xB9 0x01 (NVM write operation)
Please note that changes, made on the NVM shadow registers of the device, make permanent any change, an
“NVM write operation” needs to be performed by accessing the NVM control register. If this operation is not
performed, previously programmed, I2C address is loaded by NVM during next power-up sequence.
The NVM control register is located at address 0xB9 in which, the NVM write operation is performed by writing the
data 0x01.

AN5440 - Rev 1 page 6/16


AN5440
Example 2: how to change NVM content from the STPMIC1A to the STPMIC1B

1.4 Example 2: how to change NVM content from the STPMIC1A to the STPMIC1B
The STPMIC1A version can be (re)programmed to the STPMIC1B version; the main differences between the two
version are:
- LDO2 from 1.8 V to 2.9 V
- LDO2 from RANK0 to RANK2
- BUCK3 from 3.3 V to 1.8 V
- VINOK_Rise from 3.5 V to 3.3 V
The addresses to make the changes are:
- LDO2_VOUT 0xFD bit [3:2]
- LDO2_RANK 0xFA bit [3:2]
- BUCK3_VOUT 0xFC bit [5:4]
- VINOK_THRES 0xF8 bit [5:4]

1.4.1 GUI use


The GUI software has dedicated tabs to read/write by clicking a button, below you can see the page for NVM
content (as a configurator). By clicking “Read NVM user sector” you can read the STPMIC1 version, the window
“NVM user sector data” shows the NVM content and for version A the result is:

EE 92 C0 02 F2 80 02 33

The 4 bits highlighted must be changed to obtain the B version starting from the A version

DE 92 C8 02 D2 88 02 33

Figure 9. NVM user version A

AN5440 - Rev 1 page 7/16


AN5440
Example 2: how to change NVM content from the STPMIC1A to the STPMIC1B

The figure below shows the right settings to convert the STPMIC1 to version B. The “NVM write operation” starts
automatically by clicking the “Write NVM user sector” button and all contents are transferred from shadow
registers to the NVM contents, the next power ON cycle makes effective the changes.

Figure 10. NVM user version B

1.4.2 Command line use


First, read the default values for A version using the commands below:
- i2cget -y 0 0x33 0xF8-> 0xEE
- i2cget -y 0 0x33 0xFA -> 0xC0
- i2cget -y 0 0x33 0xFC -> 0xF2
- i2cget -y 0 0x33 0xFD -> 0x80
Then, write changes to convert A to B version using the commands below:
- i2cset -y 0 0x33 0xF8 0xDE
- i2cset -y 0 0x33 0xFA 0xC8
- i2cset -y 0 0x33 0xFC 0xD2
- i2cset -y 0 0x33 0xFD 0x88
- i2cset -y 0 0x33 0xB9 0x01 (NVM write operation)
- Done, new configuration is available the next power-up cycle

AN5440 - Rev 1 page 8/16


AN5440
Example 3: how to change NVM content from the STPMIC1C to STPMIC1A

1.5 Example 3: how to change NVM content from the STPMIC1C to STPMIC1A
The STPMIC1C version can be (re)programmed to the STPMIC1A version; the main differences between the two
version are:
- All LDOs output voltages
- All LDOs Rank#
- All buck converters output voltages
- All buck converters Rank#
- All optional settings by default

1.5.1 GUI use


The GUI software has dedicated tabs to read/write by clicking a button. Below the page for NVM content (as a
configurator) is visible.
By clicking “Read NVM user sector”, the STPMIC1 version can be read and the window “NVM user sector data”
shows the NVM content; concerning version C, the result is:

EA 00 00 00 00 80 00 33

The values below must be written to convert the STPMIC1 version from C to A

EE 92 C0 02 F2 80 02 33

Figure 11. NVM user version C

The following steps should be performed:


- Set all output voltages the application needs
- Set all Rank numbers for all the output voltages
- Set long press key function

AN5440 - Rev 1 page 9/16


AN5440
Example 3: how to change NVM content from the STPMIC1C to STPMIC1A

The figure below shows the right settings to program the STPMIC1 version A. The “NVM write operation” starts
automatically by clicking the “Write NVM user sector” button and all contents are transferred from shadow
registers to the NVM contents, the next power ON cycle makes effective the changes.

Figure 12. NVM user version A

AN5440 - Rev 1 page 10/16


AN5440
Example 3: how to change NVM content from the STPMIC1C to STPMIC1A

1.5.2 Command line use


First step, read the default values for C version using the commands below:
- i2cget -y 0 0x33 0xF8 -> 0xEA
- i2cget -y 0 0x33 0xF9 -> 0x00
- i2cget -y 0 0x33 0xFA -> 0x00
- i2cget -y 0 0x33 0xFB -> 0x00
- i2cget -y 0 0x33 0xFC -> 0x00
- i2cget -y 0 0x33 0xFE -> 0x00
Then, write changes to convert C to A version using the commands and values below:
- i2cset -y 0 0x33 0xF8 0xEE
- i2cset -y 0 0x33 0xF9 0x92
- i2cset -y 0 0x33 0xFA 0xC0
- i2cset -y 0 0x33 0xFB 0x02
- i2cset -y 0 0x33 0xFC 0xF2
- i2cset -y 0 0x33 0xFE 0x02
- i2cset -y 0 0x33 0xB9 0x01 (NVM write operation)
- Done, new configuration is available next power-up cycle

AN5440 - Rev 1 page 11/16


AN5440

Revision history

Table 1. Document revision history

Date Version Changes

04-Feb-2020 1 Initial release.

AN5440 - Rev 1 page 12/16


AN5440
Contents

Contents
1 General considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1 Hardware considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Programming steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Example 1: how to change I²C device addresss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.1 GUI use. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.3.2 Command line use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.4 Example 2: how to change NVM content from the STPMIC1A to the STPMIC1B . . . . . . . . . 7
1.4.1 GUI use. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.4.2 Command line use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.5 Example 3: how to change NVM content from the STPMIC1C to STPMIC1A . . . . . . . . . . . . 9
1.5.1 GUI use. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.5.2 Command line use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

AN5440 - Rev 1 page 13/16


AN5440
List of tables

List of tables
Table 1. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

AN5440 - Rev 1 page 14/16


AN5440
List of figures

List of figures
Figure 1. STEVAL-PMIC1x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Figure 2. USBSTICK – I2C to USB interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 3. ST GUI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 4. Minimum system requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 5. I2C BUS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 6. General tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 7. I2C settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 8. I2C settings with new address value 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 9. NVM user version A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 10. NVM user version B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 11. NVM user version C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 12. NVM user version A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

AN5440 - Rev 1 page 15/16


AN5440

IMPORTANT NOTICE – PLEASE READ CAREFULLY


STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST
products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST
products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of
Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other product or service
names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2020 STMicroelectronics – All rights reserved

AN5440 - Rev 1 page 16/16

You might also like