Post Go back to editing

AD5940: Wakeup and Sleep Timer Setup

Category: Software
Product Number: AD5940
Software Version: v0.2.1

I am trying to understand the purpose of some hardcoded numbers in the example code. I see similar lines of code in Amperometric.c, ChronoAmperometric.c, Electrocardiograph.c, Impedance.c, etc...   Specifically, I am curious about these two lines of code:

      1. wupt_cfg.SeqxSleepTime[SEQID_0] = 4-1;
      2. wupt_cfg.SeqxWakeupTime[SEQID_0] = (uint32_t)(AppAMPCfg.WuptClkFreq*AppAMPCfg.AmpODR)-4-1;
The recommended operation on Page 107 (Rev D datasheet) is to disable to sleep timer and use the sequencer to put the device in sleep mode at the of the sequence.  If we are not using the Sleep timer, the:
Q1:  Is Line#1 even necessary?  
Q2:  If not, do we need the "-4-1" in Line#2?
Q3:  Is the "-1" due to the hardware operation?  In other words, does the timer trigger an action at the end of the 0 count?
I also see a "-2" in places instead of the "-1" (see SqrWaveVoltammetery.c) and code comments in other files that say "The minimum is 1.  Do not set it to zero...."
Q4:  Why a "-2" in places?  Is there a minimum?  Please explain the origin of these numbers, any minimum setting that should be used.
Thank you

Added the product number to the subjetc field
[edited by: JEstayo at 2:08 AM (GMT -5) on 22 Feb 2024]
Parents Reply Children
No Data