A N 3 7 0
20
Rev. 1.0
5. User Application Required Interrupt Service Routines
The device API and user application cannot function without the temperature sensor demodulator module running
behind the scenes and measuring temperature. The same module is used when measuring battery voltage.
For the system to be functional the user must include a temperature sensor demodulator interrupt service routine
(DMD ISR) in the main application code. At least two DMD TS module calls must be included in the DMD ISR as
shown in the example below.
Listed below are API functions relying on the DMD ISR to be present and running, meaning that DMD ISR must be
actively invoked and interrupting the functions listed:
vFCast_Tune()
vSys_LpOscAdj()
vStl_PreLoop()
vStl_SingleTxLoop()
iMVdd_Measure()
The following construct also relies on the DMD ISR running and interrupting the function the construct is in. The
construct is a wait the first valid DMD ISR sample to be generated by the DMD ISR:
while ( 0 == bDmdTx_GetSamplesTaken() ) {}
All functions from the DMD TS module with module prefix
DmdTs_*
also require the DMD ISR to be present in the system.
The user is free to use the using directive when defining ISR functions. The downside of not using the using
directive when defining an ISR is that when the ISR is invoked the system needs to store 13 bytes of data on the
stack, on top of 2 bytes of the return address. Therefore, stack requirements are more pronounced if the using
directive is not used.
If the user is using two interrupt priorities it is recommended that the register bank 2 (RB2) is used for the DMD
ISR. The example show the RB2 used since that choice would be universal for single or dual priority levels. If the
user system uses only single ISR priority level in the whole system then the RB1 can be used in the DMD ISR.
Required DMD ISR. The ISR must call two DMD TS functions as shown.
/*
*------------------------------------------------------------------------------
*
* INCLUDES:
*/
#include "si4010.h"
#include "si4010_api_rom.h"
/*
*==============================================================================
*
* VISIBLE FUNCTIONS:
*/
void vIsr_Dmd
(
void