Status registers

First loop indicator

The S0 register indicates execution of the first loop of WESCL firmware. It happens always after:

Example 3-2. Using first loop indicator


 S0 : M0 = 0, M1 = 0, M2 = 0;
initializing M0..M2 variables to zero at startup.

Date and time registers

The following table shows description of registers, which contain information about current date and time.

Register nameDescription
S20year (long format e.g. 2000)
S21year (short format e.g. 00)
S22month (1..12)
S23day (1..31)
S24weekday (0..6) Sunday = 0
S25hour (0..23)
S26minutes (0..59)
S27seconds (0..59)
S28milliseconds (0, 100, 200, 300, 400, 500, 600, 700, 800, 900)

Hardware counter

The following table shows registers, which are available on EvalBoard II only (and operate on hardware counter connected to its digital input I12):

Register nameDescription
S12Shows the current value of hardware counter (0..255)
S13Writing a non-zero value to this register causes resetting of the hardware counter.

Division by zero

S2 register stores information about division (/,%) by zero exception. In this situation S2 contains a non-zero value and the result of division is equal to -32768 or 32767 depending on the sign of the operation. WESCL does not clear this register automatically, so it is the programmer's responsibility to do so.