Page 131 of 229 Start Back Next End ZBasic Language Reference 121 ZBasic Microcontrollers Examples --device-parameter=WriteWordAddress,0x812 --device-parameter=WritePageAddress,&H814 Option DeviceParameter WriteWordAddress "0x812" Option DeviceParameter WritePageAddress "&H814" clkCtrl, psCtrl, oscCtrl, xoscCtrl, pllCtrl clkCtrl <value> Default: 0 psCtrl <value> Default: 0 oscCtrl <value> Default: ¹ xoscCtrl <value> Default: 0 pllCtrl <value> Default: 0 These parameters, usually required for and applicable only to xmega devices, are used to specify the clock system initialization values written to the corresponding xmega registers as shown in the table below. ATxmega Register Mapping Parameter xmega Register clkCtrl CLK_CCTRL psCtrl CLK_PSCTRL oscCtrl OSC_CTRL xoscCtrl OSC_XOSCCTRL pllCtrl OSC_PLLCTRL Details regarding the appropriate values for these parameters can be found in the Atmel Xmega documentation. The example values shown below are those used by the xmega-based ZX devices that use a 14.7MHz crystal and run at 29.5MHz. They would work equally well with any 12-16MHz crystal frequency if an internal 2X operating speed is desired. The default values configure the xmega to run on the internal 2MHz RC oscillator. Examples --device-parameter=clkCtrl,0x04 --device-parameter=psCtrl,0x03 --device-parameter=oscCtrl,0x08 --device-parameter=xoscCtrl,0xcb --device-parameter=pllCtrl,0xc8 Option DeviceParameter clkCtrl "0x04" Option DeviceParameter psCtrl "0x03" Option DeviceParameter oscCtrl "0x08" Option DeviceParameter xoscCtrl "0xcb" Option DeviceParameter pllCtrl "0xc8" 5.4 ZBasic Bootloader The ZBasic Bootloader facilitates downloading of code to a generic target device without needing special programming hardware. Such hardware is needed, of course, for the initial installation of the bootloader but after bootloader installation application code can be downloaded without the programming hardware. The ZBasic installer automatically installs the source code, build scripts and related files for the ZBasic Bootloader. These can be found in the zboot subdirectory of the ZBasic installation directory. Pre-built bootloaders for the supported devices are also installed (see zboot/boot). The pre-built bootloaders are configured for devices running at 16MHz (important for ATtiny and ATmega devices only) and a download speed of 115.2K baud. If you want a different download speed or your ATTiny/ATmega runs at a different speed, you’ll have to rebuild to get a compatible bootloader image.