78 of 208
ZBasic Language Reference 70 ZX Microcontroller Family Register.ATNChar This read/write Byte value gives represents a special trigger character that, if received on the Com1 serial channel, will put the ZX device into “command mode”. The purpose of the ATN character is to facilitate downloading code to the device without using the normal DTR toggling trigger. The value of Register.ATNChar will act as a trigger only if its value is in the range &H01 to &H1f (1 to 31 decimal). The default value of Register.ATNChar is 0. Register.ResetFlags Whenever the processor is reset, the cause of the reset is noted and stored in an internal variable that is available to user programs as Register.ResetFlags. The bits of the Byte value have the meaning shown in the table below. ResetFlags Bit Semantics Reset Source ATmega ATxmega Power On Reset &H01 &H01 External Reset &H02 &H02 Brown Out Reset &H04 &H04 WatchDog Reset &H08 &H08 Debug Interface Reset &H10 Software Reset &H20 Spike Detection Reset &H40 The value of this register is set just before the ZX begins executing your program. The value is not used by the control program in any manner so you may modify it to suit the needs of your application. Note that more than one bit may be set. Register.RTCDay Register.RTCTick These two register values (both available in BasicX compatibility mode) represent the current state of the real time clock (RTC). Register.RTCTick is a Long value that is incremented on each RTC tick (see Register.RTCTickFrequency). After 24 hours of continuous execution, it will reach its maximum value and will then roll over to zero. At the same time, the value of Register.RTCDay, type UnsignedInteger, will be incremented. Day number zero represents January 1, 1999 (for compatibility with BasicX). When the system is reset or powered up both of these values are initialized to zero. Register.RTCFastTick This Byte value changes twice as fast as Register.RTCTick (except on devices running at 7.37MHz). For most purposes, this value should be considered to be read-only. Changing it will affect the accuracy of the RTC and may interfere with normal task switching. Register.RTCStopWatch This UnsignedInteger value is incremented on each RTC tick (see Register.RTCTickFrequency), the same as Register.RTCTick. However, you may reset this value to zero at any time to facilitate simpler elapsed time calculations without affecting the RTC’s timekeeping. This register variable is available in BasicX compatibility mode.