A N 3 7 0
92
Rev. 1.0
vSys_FirstPowerUp
Description
: To be called at the beginning of the user application when the POW-
ER_1ST_TIME field of the SYSGEN register is 1. It is the responsibility of the user appli-
cation to check this bit. Boot routine does not do check the bit. The main task of this
function is to force bandgap on while waiting for battery insertion voltage transients to
take place.
Important
: Function vSys_Setup() must be called before calling this function!
The function does the following:
1. Initialize the Sleep Timer.
2. Clear the HVRAM.
3. Initialize the HVRAM battery voltage byte to 0xFF.
4. Waits for the time specified by the argument biFirstBatteryInsertWaitTime of
vSys_Setup().
5. Calls vSys_Shutdown().
For example
:
/* Call the system setup */
vSys_Setup( 20 ); /* Wait 800ms */
/* Check the first power on bit */
if ( 0 != (SYSGEN & M_POWER_1ST_TIME) )
{
vSys_FirstPowerUp(); /* Function will shutdown */
}
Inputs
:
None
Outputs
:
None
vSys_16BitDecLoop
Description
: Implements software delay by waiting in a delay loop. The function stores
the current SYSGEN_DIV field in the SYSGEN SFR and forces it to 0, forcing the fastest,
24 MHz, system clock frequency. Before returning, the function restores the SYS-