S-35710 is a Wakeup timer IC (1s to194days) made by ABLIC. This posting will provide the OSS-ECAL(Open Source Software for Electronic Components Abstraction Layer) for S-35710.
MCU interface : I2C, GPIO
CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.
S-35710
General description
The wake-up timer IC allows for intermittent system operation by periodically waking up the system.
The S-35710M compares the timer value and the value written to the internal register, and outputs a wake-up signal (interrupt signal) when the values match each other.
The timer of the S-35710M is a 24-bit binary-up counter.
The internal register data can be set freely by users via a 2-wire serial interface. Consequently, the time before the occurrence of a wake-up signal (interrupt signal) can be set freely.
Since the S-35710M has a built-in quartz crystal, a matching assessment of the IC and the quartz crystal is unnecessary.
Moreover, the number of external parts can also be reduced.
Feature
- Built-in 32.768 kHz quartz crystal
- Wake-up function (Alarm interrupt function): Settable on the second time scale from 1 second to 194 days
(Approximately half a year) - Low current consumption: 0.25 μA typ. (VDD = 3.0 V, Ta = +25°C)
- Wide range of operation voltage: 1.8 V to 5.5 V
- 2-wire (I2C-bus) CPU interface
- Operation temperature range: Ta = −40°C to +85°C
- Lead-free (Sn 100%), halogen-free
Application
- IoT communications device
- Monitoring device
- Security device
- Battery system
- Energy harvesting system
OSS-ECAL specification
API Function
etSTS oS35710( etCMD cmd, uint32 wut, stS35710_O* rlt )
The oS35710 function is an API function that executes S-35710 processing according to the command in the argument.
Return value | etSTS | OSS-ECALステータスコード | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_COMMAND_CODE | Command selection error | ||
eSTS_ERR_DIAG | If the diagnosis result is NG with the following command. eCMD_DIAG_WUR eCMD_DIAG_TR eCMD_DIAG_CLEAR | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMD cmd | OSS-ECAL command code | |
eCMD_CLEAR | Command to clear the time register and wake-up time register to zero by setting the /RST pin to low. 1. /RST pin Low. 2. Wait until 438ms has passed (return value eSTS_EXE while waiting). NOTE : The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD [ms]. /RST pin continues Low. To count up the Wake-up time, execute the command eCMD_COUNTUP. | ||
eCMD_COUNTUP | Command to set the /RST pin to Hi and count up the time register. 1. /RST pin Hi. 2. Wait until 438ms has passed (return value eSTS_EXE while waiting). NOTE : The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD [ms]. /RST pin continues Hi. | ||
eCMD_WRITE_WUR | Command to write wut value (24bit) to wake-up time register. 1. Write the value of wut (24bit) to the wake-up time register. NOTE : Please do this when in the write mode (/RST pin Hi). | ||
eCMD_READ_WUR | Command to read the value of the wakeup time register (24bit) and save it in rlt.wakeup_reg. 1. Read the value of the wakeup time register (24bit) and save it in rlt.wakeup_reg. NOTE : Please do this when in the write mode (/RST pin Hi). | ||
eCMD_READ_TR | Command to read the value of the time register (24bit) and save it to rlt.timer_reg. 1. Read the value of the time register (24bit) and save it to rlt.timer_reg. NOTE : | ||
eCMD_DIAG_WUR | Command to diagnose write to wake-up time register. 1. /RST pin Hi. 2. Wait until 438ms has passed (return value eSTS_EXE while waiting). 3. Write the value of wut (24bit) to the wake-up time register. 4. Read the value of wake-up time register (24bit). 5. Returns the comparison result between wut and wake-up time register value as the return value. True : eSTS_FIN False : eSTS_ERR_DIAG NOTE : The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms]. | ||
eCMD_DIAG_TR | Command to diagnose time register count up. 1. /RST pin Hi. 2. Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting). 3. Read the value of time register (24bit). 4. Returns the comparison result between S35710_DIAG_TIME[s] and the time register value as the return value. True … eSTS_FIN False … eSTS_ERR_DIAG NOTE : S35710_DIAG_TIME should be set to 1 (1 second) or more. S35710_DIAG_TIME[s] The elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms]. | ||
eCMD_DIAG_CLEAR | Command to diagnose zero-clearing of the time and wake-up time registers. 1. /RST pin Hi. 2. Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting). 3. Write the value of wut (24bit) to the wake-up time register. 4. /RST pin Low. 5. Wait until 438ms has passed (return value eSTS_EXE while waiting). 6. Read the value of time register (24bit). 7. /RST pin Hi. 8. Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting). 9. Read the value of wake-up time register (24bit). 10. Returns the zero check result of the time register value and wake-up time register value as the return value. True … eSTS_FIN False … eSTS_ERR_DIAG NOTE : S35710_DIAG_TIME[s] and 438ms elapsed time are calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms]. | ||
uint32 wut | Wake-up time [s] | 24bit | |
Parameter OUT | stS35710_O* rlt | Receive data from S-35710 | |
uint32 timer_reg | Time register value[s] | ||
uint32 wakeup_reg | Wake-up time register value[s] |
etSTS oS35710_CLEAR( void )
The oS35710_CLEAR function is an API function to zero-clear the Time Register and Wakeup Time Register with the /RST pin held Low.
- /RST pin Low.
- Wait until 438ms has passed (return value eSTS_EXE while waiting).
NOTE :
The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
/RST pin continues Low. To count up the Wake-up time, execute the command eCMD_COUNTUP.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oS35710_COUNTUP( void )
The oS35710_COUNTUP function is an API function that counts up the Time register with the /RST pin set to Hi.
- /RST pin Hi.
- Wait until 438ms has passed (return value eSTS_EXE while waiting).
NOTE :
The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
/RST pin continues Hi.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oS35710_WRITE_WUR( uint32 wut )
The oS35710_WRITE_WUR function is an API function to write the wut value (24bit) to the wake-up time register.
- Write the value of wut (24bit) to the wake-up time register.
NOTE :
Please do this when in the write mode (/RST pin Hi).
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | uint32 wut | Wake-up time [s] | 24bit |
etSTS oS35710_READ_WUR( stS35710M_O* rlt )
The oS35710_READ_WUR function is an API function that reads the value of the wakeup time register (24bit) and stores it in rlt.wakeup_reg.
- Read the value of the wakeup time register (24bit) and save it in rlt.wakeup_reg.
NOTE :
Please do this when in the write mode (/RST pin Hi).
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter OUT | stS35710_O* rlt | Receive data from S-35710 | |
uint32 timer_reg | Time register value[s](not updated) | ||
uint32 wakeup_reg | Wake-up time register value[s] |
etSTS oS35710_READ_TR( stS35710M_O* rlt )
The oS35710_READ_TR function is an API function that reads the value of the time register (24bit) and stores it in rlt.timer_reg.
- Read the value of the time register (24bit) and save it to rlt.timer_reg.
NOTE :
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter OUT | stS35710_O* rlt | Receive data from S-35710 | |
uint32 timer_reg | Time register value[s] | ||
uint32 wakeup_reg | Wake-up time register value[s](not updated) |
etSTS oS35710_DIAG_WUR( uint32 wut )
The oS35710_DIAG_WUR function is an API function to diagnose wake-up time register write.
- /RST pin Hi.
- Wait until 438ms has passed (return value eSTS_EXE while waiting).
- Write the value of wut (24bit) to the wake-up time register.
- Read the value of wake-up time register (24bit).
- Returns the comparison result between wut and wake-up time register value as the return value.
True … eSTS_FIN
False … eSTS_ERR_DIAG
NOTE :
The 438ms elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD [ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_DIAG | Wake-up time register write diagnostic NG | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | uint32 wut | Wake-up time [s] | 24bit |
etSTS oS35710_DIAG_TR( void )
The oS35710_DIAG_TR function is an API function to diagnose the count-up of the time register.
- /RST pin Hi.
- Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting).
- Read the value of time register (24bit).
- Returns the comparison result between S35710_DIAG_TIME[s] and the time register value as the return value.
True … eSTS_FIN
False … eSTS_ERR_DIAG
NOTE :
S35710_DIAG_TIME should be set to 1 (1 second) or more.
S35710_DIAG_TIME[s] The elapsed time is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_DIAG | Time register count-up diagnostic NG | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oS35710_DIAG_CLEAR( uint32 wut )
The oS35710_DIAG_CLEAR function is an API function to diagnose zero-clearing of the time and wake-up time registers.
- /RST pin Hi.
- Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting).
- Write the value of wut (24bit) to the wake-up time register.
- /RST pin Low.
- Wait until 438ms has passed (return value eSTS_EXE while waiting).
- Read the value of time register (24bit).
- /RST pin Hi.
- Wait until S35710_DIAG_TIME[s] have elapsed (return value eSTS_EXE while waiting).
- Read the value of wake-up time register (24bit).
- Returns the zero check result of the time register value and wake-up time register value as the return value.
True … eSTS_FIN
False … eSTS_ERR_DIAG
NOTE :
S35710_DIAG_TIME[s] and 438ms elapsed time are calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_DIAG | Wake-up time register zero-clearance diagnostic NG | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process. | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL. | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | uint32 wut | Wake-up time [s] | 24bit |
Caution
INT signal input should be handled by the user’s program.
Files
Folder* | File | summary |
---|---|---|
S35710_HALNAME_VERSION/sample | sample.c (.cpp) | Sample Application Program |
| sample.h | Sample Application Header |
S35710_HALNAME_VERSION | oS35710.c (.cpp) | OSS-ECAL Program for S-35710 |
| oS35710.h | OSS-ECAL Header for S-35710 |
S35710_ARDUINO.ino | Sample application programs for Arduino | |
| oss_ecal.h | OSS-ECAL Common Header (Ver 01.01.00 or later, AUTOSAR is Ver 01.01.07 or later) |
| user_setting.c (.cpp) | Const and Table of User setting |
| user_setting.h | Header of User setting |
oHAL_i2c_stm32f4.c | HAL Program for STM32Cube FW_F4 | |
oHAL_i2c_stm32f4.h | HAL Header for STM32Cube FW_F4 | |
| readme.md | Readme |
| OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
* For HALNAME, please refer to HAL Support.
HAL Support List
HAL | MCU* | Development environment* | HALNAME |
---|---|---|---|
Arduino 1.8.6 | ATmega2560 ATmega328P | Mega 2560 Rev3 Arduino Pro Mini 3.3V | ARDUINO |
ARM Mbed 6.17.0 | STM32F401RE | STM32 Nucleo-64 boards | MBED |
Infineon ModusToolbox HAL Cat1 2.4.3 | CYBLE-416045-02 | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | ModusToolbox |
NXP MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | MIMXRT1052DVL6A | IMXRT1050-EVKB | iMXRT1051B1052B |
Renesas SSP 2.4.0 | R7FS7G27H3A01CFC | S7G2 SK | SSP |
STM STM32Cube FW_F4 V1.27.1 | STM32F401RE | STM32 Nucleo-64 boards | STM32F4 |
Debian(Linux) v2022.04 | TI AM335x | BeagleBone Black – Rev C | Linux |
* MCU and development environment at the time of development. Even if the same HAL is used, different MCUs and development environments may not work together.
OSS-ECAL Download Contact
Please login before contacting us for downloads.
To register as a new user, click here.
Built-in How to
How to incorporate OSS-ECAL into user programs
How to incorporate multiple OSS-ECALs in a user program (same MCU function)
How to incorporate multiple OSS-ECALs in a user program (different MCU function)
How to incorporate multiple identical electronic components into a user program
How to reduce the impact on user programs by replacing electronic components
CAUTION
The sample version of OSS-ECAL is not intended to be used with Threads (Tasks) or interrupts of different priority. Please do not use it as in the example below.
Example: If each sensor is assigned to the same ADC group and the OSS-ECAL API is executed in processes with different priorities, correct values may not be obtained.
ADC Gr0 Ch0 Temperature sensor AD22100A 100ms cycle Thread (low priority) to take in temperature
ADC Gr0 Ch1 Pressure sensor MPX5999D Event interrupts (high priority) to take pressure