Start Back Next End
  
ZBasic Language Reference
69
ZBasic Microcontrollers
Register.ATNChar
This read/write Byte value gives represents a special trigger character that, if received on the Com1
serial channel, will put the ZBasic 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 &H00 to &H1f (0 to 31 decimal).  The
default value of Register.ATNChar is 0Hff, effectively disabling the feature.
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/ATtiny
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 ZBasic Device begins executing your program.  The value
is not used by the system 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 at a rate equal to that of Register.RTCTick times the value of RTCScale. 
For ZX devices, RTCScale is 2 except for devices running at 7.37MHz where it is 1.  For generic target
devices, RTCScale is a configurable parameter.  For most purposes, the value of Register.RTCFastTick
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.
Previous page Top Next page