From ce915cbfca564cfb9eba79c6dd9f8a32671710bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=B2=E5=B1=8E=E5=B0=86=E5=86=9B?= <37292630+wlmh110@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:51:05 +0800 Subject: [PATCH] Updated PiSugar 3 Series (markdown) --- PiSugar-3-Series.md | 213 +++++++++++++++++--------------------------- 1 file changed, 84 insertions(+), 129 deletions(-) diff --git a/PiSugar-3-Series.md b/PiSugar-3-Series.md index 67ad1d4..3dfb47c 100644 --- a/PiSugar-3-Series.md +++ b/PiSugar-3-Series.md @@ -23,7 +23,7 @@ PiSugar 3 is the third generation of PiSugar Raspberry Pi battery power supply s * **Custom button** * **Soft shutdown** - (hardware notification software shutdown) + (hardware notification software shutdown) * **WebUI** * **Software watchdog** @@ -36,21 +36,15 @@ PiSugar 3 is the third generation of PiSugar Raspberry Pi battery power supply s PiSugar 3 provides hardware battery protection like never before, limiting battery voltage to nearly 80%. When charging protection is turned on, the battery cycles life can be improved. - - - ## Electrical Specifications -| Electrical Specifications | PiSugar 3 Plus | PiSugar 3 | +| Electrical Specifications | PiSugar 3 Plus | PiSugar 3 | | :------ | :-----: | :----: | | Input| 5V-3Amax |5V-3Amax | | Output | 5V-3Amax | 5V-2.5Amax | | Battery capacity | 5000mah | 1200mah | | Communication interface | 0x57/0x68 address | 0x57/0x68 address | - - - ## Table of I2C c.ntrol @@ -62,178 +56,153 @@ PiSugar 3 is the third generation of PiSugar Raspberry Pi battery power supply s * In the I2C register, the retention bit is reserved for the system test interface and it is forbidden to write the data. * When directly modifying the I2C register, you need to read the value of the corresponding register first. Write the calculated value into this register after performing AND operation on the BIT bits that need to be modified. At the same time, make sure that only the bits that need to be modified are modified, and the values of other bits cannot be modified at will. - ## Function specifications PiSugar 3 has many advanced power functions that can be set up, which are described below. Some functions can be operated on WebUI, indicating that this function does not need to be manually set up by I2C, only in WebUI. At the same time, the WebUI interface can be set up directly through the command line. The function set through the WebUI will retain the settings in the Raspberry Pi system and will not be set to the default value after restart or battery reset. 1. External power supply detection - **Register address:** the 6th bit of the 0X02 address - **Register operation:** - can be read or written - + can be read or written **Data description:** - 1 means external power supply access, 0 means no external power supply - + 1 means external power supply access, 0 means no external power supply **Function description:** - It can be judged whether the external power supply is connected by querying the 7th bit of the 0X02 address. The detection is to detect whether the power input interface has voltage. If the plug is inserted but there is no power supply, it will be detected that the external power supply is not connected. -WebUI supports reading the status. + It can be judged whether the external power supply is connected by querying the 7th bit of the 0X02 address. The detection is to detect whether the power input interface has voltage. If the plug is inserted but there is no power supply, it will be detected that the external power supply is not connected. + + WebUI supports reading the status. 2. Charging switch - **Register address:** the 6th bit of the 0X02 address - **Register operation:** - can be read or written - + can be read or written **Data description:** - 1 is on, 0 is off - + 1 is on, 0 is off **Function description:** - When charging switch is turned on, once the external power access, the device begins charging. + When charging switch is turned on, once the external power access, the device begins charging. **default value:** - This function will be reset to on each time the device is turned off + This function will be reset to on each time the device is turned off **WebUI does not support this function.** 3. Output switch - **Register address:** the 5th bit of the 0X02 address - **Register operation:** - can be read or written - + can be read or written **Data description:** - 1 is on, 0 is off - + 1 is on, 0 is off **Function description:** - When output switch is turned off, PiSugar does not output voltage externally. When output switch is turned on, PiSugar outputs 5V voltage externally. If the automatic hibernate -function is turned on and PiSugar is turned off, the PiSugar system will immediately go into the hibernate -state, and I2C will be inoperable. -(About turning off PiSugar: The shutdown command is executed in the PiSugar-Poweroff client.) + When output switch is turned off, PiSugar does not output voltage externally. When output switch is turned on, PiSugar outputs 5V voltage externally. If the automatic hibernate function is turned on and PiSugar is turned off, the PiSugar system will immediately go into the hibernate state, and I2C will be inoperable. + + (About turning off PiSugar: The shutdown command is executed in the PiSugar-Poweroff client.) **default value:** - This function will be reset to on each time the device is turned on. + This function will be reset to on each time the device is turned on. **WebUI does not support this function.** 4. Automatically resume booting when power is reconnected - **Register address:** the 4th bit of the 0X02 address. - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - 1 is on, 0 is off. - + 1 is on, 0 is off. **Function description:** - a. When this function is turned on and PiSugar is turned off, once the external power supply is restored, PiSugar will automatically turn on and start the external output. b. When this function is turned off, once the external power supply is restored, PiSugar will charge, but will not output externally. -If you need to awake the Raspberry Pi even when PiSugar is powered on, please refer to the SCL awakening function. + a. When this function is turned on and PiSugar is turned off, once the external power supply is restored, PiSugar will automatically turn on and start the external output. + + b. When this function is turned off, once the external power supply is restored, PiSugar will charge, but will not output externally. + + If you need to awake the Raspberry Pi even when PiSugar is powered on, please refer to the SCL awakening function. - **default value:** - This function is on by default. It resets to on each time the PiSugar system is completely reset. + This function is on by default. It resets to on each time the PiSugar system is completely reset. WebUI supports this function. 5. Anti-mistaken touch function - **Register address:** the 3rd bit of the 0X02 address. - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - 1 is on, 0 is off. - + 1 is on, 0 is off. **Function description:** - a. When anti-mistaken touch function is turned on, if PiSugar shuts down, first short press the power button, and then release, the LED will indicate the current power. Next, press and hold the power button to achieve the purpose of booting. When anti-mistaken touch function is turned off, short press the power button to trigger the boot. b. Whether the function is turned on or not, when PiSugar is turned on, it needs to be turned off by a long press. c. We can judge whether the current power button is pressed by reading the last bit of the 0X02 address. - **default value:** - This function is on by default. It resets to on each time the PiSugar system is completely reset. + This function is on by default. It resets to on each time the PiSugar system is completely reset. **WebUI does not support this function.** 6. Automatic hiberate function: - **Register address:** the 6th bit of the 0X03 address. - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - 1 is on, 0 is off. - + 1 is on, 0 is off. **Function description:** - This function is related to the output switch function. - + This function is related to the output switch function. + a. When automatic hiberate function is turned on, once the output function is turned off, PiSugar will go into hiberate. At that time, I2C communication and custom switches are not available, while the power button, external power detection, RTC and timer switch machines work normally. b. When the automatic hiberate function is turned off, PiSugar is always on regardless of whether the output switch is off. At that time, all functions including I2C are working normally. @@ -247,199 +216,185 @@ WebUI supports this function. 7. Soft shutdown function - **Register address:** 1. set up:he 4th bit of the 0x03 address; 2. query whether to enter the soft shutdown state: the 3rd bit of the 0x03 address. - **Register operation:** - can be read or written - + can be read or written **Data description:** - 1 is on, 0 is off - + 1 is on, 0 is off **Function description:** - The soft shutdown function is set for shutdown behavior for the power button. + The soft shutdown function is set for shutdown behavior for the power button. + a. When the soft shutdown function is turned off, while PiSugar is working, press and hold the power button for more than 2 seconds to directly turn off the power. + b. When the soft shutdown function is turned on, press and hold the power button will not directly turn off the output. Instead, it indicates that the system has triggered the shutdown process and should start to execute the shutdown command through the 3rd query bit of the 0x03 address. **default value:** - This function is off by default, it resets to off when restarting. + This function is off by default, it resets to off when restarting. 8. Chip temperature - **Register address:** 0X04 address. - **Register operation:** - can be read - + can be read **Data description:** - 0 means -40 degrees Celsius - + 0 means -40 degrees Celsius **Function description:** - The temperature measurement is in the range of -40 to 85 degrees Celsius. This temperature is only the temperature of the chip itself, it does not represent the temperature of the Raspberry Pi, nor does it represent the temperature of the battery. + The temperature measurement is in the range of -40 to 85 degrees Celsius. This temperature is only the temperature of the chip itself, it does not represent the temperature of the Raspberry Pi, nor does it represent the temperature of the battery. + **WebUI does not support this function.** 9. Software watchdog - **Register address:** The function switch: the 7th bit of the 0X06 address, the watchdog reset: the 5th bit of the 0x06 address, the watchdog interval time: the 0x07 address. - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - 1 is on, 0 is off. -Writing 1 on the watchdog reset setting bit will reset the watchdog timer (kicking the dog). The watchdog delay is set to the register value*2s, for example, when the register value is 0x05, the actual watchdog delay is 5*2s=10s. + 1 is on, 0 is off. + Writing 1 on the watchdog reset setting bit will reset the watchdog timer (kicking the dog). + + The watchdog delay is set to the register value X 2s, for example, when the register value is 0x05, the actual watchdog delay is 5X2s=10s. **Function description:** - The software watchdog provides a watchdog other than the Raspberry Pi system, which restarts the Raspberry Pi system when the Raspberry Pi system crashes. When this function is turned on, if the watchdog timer is not reset (kicking the dog) within the software watchdog time interval, PiSugar will temporarily turn off the output to achieve the purpose of restarting the Raspberry Pi system. The operation of kicking the dog needs to be completed by the user. + The software watchdog provides a watchdog other than the Raspberry Pi system, which restarts the Raspberry Pi system when the Raspberry Pi system crashes. When this function is turned on, if the watchdog timer is not reset (kicking the dog) within the software watchdog time interval, PiSugar will temporarily turn off the output to achieve the purpose of restarting the Raspberry Pi system. The operation of kicking the dog needs to be completed by the user. **default value:** - This function is off by default. It is off by default each time it restarts. - **WebUI does not support this function.** + This function is off by default. It is off by default each time it restarts. + **WebUI does not support this function.** + 10. Charging protection - **Register address:** + **Register address:** - the 7th bit of the 0X20 address. + the 7th bit of the 0X20 address. - **Register operation:** + **Register operation:** - can be read or written. + can be read or written. - **Data description:** + **Data description:** - 1 is on, 0 is off. + 1 is on, 0 is off. - **Function description:** + **Function description:** - PiSugar 3 provides hardware charging protection function. + PiSugar 3 provides hardware charging protection function. - When this function is turned on, the fully charged power is approximately equivalent to 80% of the battery power, and the voltage will be limited to about 3.8V. Enabling this function will greatly extend the cycle life of the battery by about 8 times (calculated as the battery cycle life doubles for every 0.1V drop in the charge cut-off voltage). It is recommended to turn it on under long-term charging conditions. - + When this function is turned on, the fully charged power is approximately equivalent to 80% of the battery power, and the voltage will be limited to about 3.8V. Enabling this function will greatly extend the cycle life of the battery by about 8 times (calculated as the battery cycle life doubles for every 0.1V drop in the charge cut-off voltage). It is recommended to turn it on under long-term charging conditions. **default value:** - This function is off by default, it resets to off when restarting. -WebUI supports this function. + This function is off by default, it resets to off when restarting. + + **WebUI supports this function.** 11. SCL awakening - **Register address:** the 3rd bit of the 0X20 address. - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - 1 is on, 0 is off. - + 1 is on, 0 is off. **Function description:** - This function is related to the booting function. -When the function is turned on, the SCL pin will be pulled down once PiSugar is turned on. If the Raspberry Pi is connected to the power supply but not turned on, it will be awakened. - + This function is related to the booting function. + + When the function is turned on, the SCL pin will be pulled down once PiSugar is turned on. If the Raspberry Pi is connected to the power supply but not turned on, it will be awakened. **default value:** - This function is off by default, it resets to off when restarting. + This function is off by default, it resets to off when restarting. **WebUI does not support this function.** 12. Battery capacity reading - **Register address:** 0X22, 0X23, 0X2A - **Register operation:** - can be read - + can be read **Data description:** - 0x22 is high battery voltage, 0x23 is low battery voltage. When reading, you should first arrange the two bits of data in order to get the actual voltage in mA. -For example, if the data read are 0x10 and 0x1F, the combined result will be 0x101F=4127mV=4.127V. -The 0X2A address is the calculated battery power percentage. + 0x22 is high battery voltage, 0x23 is low battery voltage. When reading, you should first arrange the two bits of data in order to get the actual voltage in mA. + For example, if the data read are 0x10 and 0x1F, the combined result will be 0x101F=4127mV=4.127V. + + The 0X2A address is the calculated battery power percentage. **Function description:** - WebUI can read the battery power percentage + WebUI can read the battery power percentage 13. RTC function - **Register address:** write protection: 0x30, data address: 0x31-0x37 - **Register operation:** - can be read or written -Operating instructions: RTC has a write protection function in order to prevent data fluctuations caused by misoperation or system instability. + can be read or written + + **Operating instructions:** + + RTC has a write protection function in order to prevent data fluctuations caused by misoperation or system instability. 14. Timing boot function - **Register address:** control bit: the 7th bit of 0x40, data address: 0x44-0x47 - **Register operation:** - can be read or written. - + can be read or written. **Data description:** - Write the control bit to 1 to turn on the timing boot function, write 0 to turn off the timing boot function. The Weekday bit ranked by bit represents from Sunday to Saturday, where 0 represents Sunday. - + Write the control bit to 1 to turn on the timing boot function, write 0 to turn off the timing boot function. The Weekday bit ranked by bit represents from Sunday to Saturday, where 0 represents Sunday. **Function description:** - a. When the function is turned on, PiSugar will turn on the output each time the specified time is reached. + a. When the function is turned on, PiSugar will turn on the output each time the specified time is reached. b. This function will not be reset due to restart. c. Turning off this function requires manual settings. -WebUI supports this function. \ No newline at end of file +WebUI supports this function.