Start Back Next End
  
ZBasic Language Reference
119
ZBasic Microcontrollers
Allowable Range of Timer Limit Values
8-bit timer (e.g. mega, tiny)
16-bit timer (e.g. xmega)
1 < timerLimit <= 256
1 < timerLimit <= 65,536
The values of the SWUartMinSpeed and SWUartMaxSpeed parameters must be in the range 300-19200
inclusively and the minimum speed must be less than or equal to the maximum speed.  For devices with
8-bit timers, the value of the SWUartBaseSpeed may be specified as greater than the minimum speed
and less than or equal to the maximum speed.
The set of base baud rates for which the timer limit value must be checked ranges from
SWUartMaxSpeed on the high end to the greater of SWUartMinSpeed and SWUartBaseSpeed (if
specified) on the low end.  Essentially, the SWUartBaseSpeed parameter provides a way to avoid
exceeding the timer limit range while still supporting the lower baud rates.  The example set of parameter
values shown below would be suitable for a target device running at 16MHz and having an 8-bit software
UART timer.  For a device running at the same speed and having a 16-bit software UART timer, the
SWUartBaseSpeed parameter is not needed.
Examples
--device-parameter=SWUartDivisor,8
--device-parameter=SWUartMinSpeed,300
--device-parameter=SWUartMaxSpeed,19200
--device-parameter=SWUartBaseSpeed,2400
Option DeviceParameter SWUartDivisor 8
Option DeviceParameter SWUartMinSpeed 300
Option DeviceParameter SWUartMaxSpeed 19200
Option DeviceParameter SWUartBaseSpeed 2400
ZBasicBootloader
ZBasicBootloader { true|false }
Default: false
This parameter specifies whether or not the target device contains a standard ZBasic bootloader.  The
source code for the standard ZBasic bootloader is supplied with the ZBasic compiler and the bootloader
code is pre-built for all supported devices (not all target devices are capable of having a bootloader). 
Installing the ZBasic bootloader requires a special device programmer (e.g. Atmel AVRISP MkII) but once
the bootloader is installed your application can be downloaded to the target device over the serial port.  
The ZBasic bootloader also provides the necessary support for writing to Program Memory.  For cases
where the ZBasic bootloader is not present, other device parameters are provided to support writing to
Program Memory for those targets and applications that need that capability.
Examples
--device-parameter=ZBasicBootloader,true
Option DeviceParameter ZBasicBootloader true
BootloaderAddress
BootloaderAddress <value>
Default: varies by device
If the ZBasicBootloader parameter is true, the ZBasic compiler assumes that the bootloader resides at
a specific address (which varies by target device).  If you rebuild the ZBasic bootloader to reside at a non-
standard address you must use this parameter (or BootloaderSize, below) to tell the compiler what
that address is.  The value, which may be given in decimal or hexadecimal (with either a 0x or &H prefix),
should specify the byte address of the first location of the bootloader.  The value may optionally include a
k or K suffix to indicate a multiple of 1024.  The examples given below all specify the same bootloader
Previous page Top Next page