Page 1 of 1

New Compiler Release, New Devices

Posted: 26 February 2015, 16:41 PM
by dkinzer
A new installer can be found on the Downloads Page that contains the ZBasic compiler v4.3.0, ZBasic Library v4.3.0, IDE v1.7.0 and updated documentation. The primary change is support for new "low power" versions of the mega1284P devices - the ZX-24t, ZX-40t and ZX-44t. These all run at 7.73 MHz and can be powered with 2.7 to 5.5VDC.

Another change is support for configuring the clock prescaler to allow any ZX device to run at a lower clock speed. This would be done primarily to reduce power consumption. The clock prescaler value is specified using the Option DeviceParameter ClockPrescaler directive. Prescaler values are supported that will reduce the operating frequency to as low as 230.4KHz. Note, however, that the maximum baud rate supported by the software serial channels is reduced by the same factor by which the clock frequency is reduced. Operating at 230.4KHz yields a maximum software serial baud rate of 300.

At the reduced operating speeds of 7.37MHz and 921.6KHz the RTC runs at 512Hz while it runs at 400Hz at all other reduced speeds. The resolution of timer-dependent routines (e.g. OutputCapture(), PulseOut(), etc.) is also affected by the reduced operating speeds.

The ZX-24t device is physically identical to the ZX-24s. The difference is that in the ZX-24t bootloader the the mega1284P clock prescaler is configured to divide the 14.7MHz crystal frequency to the 7.37MHz operating frequency. If desired, the ZX-24t operating frequency can be further reduced using the Option DeviceParameter ClockPrescaler directive.

The ZX-40t and ZX-44t are configured to use a 7.37MHz crystal.

Posted: 02 March 2015, 3:07 AM
by kranenborg
Hello Don,

Both aspects (new devices & clock prescaler selection option) are very good news for those on the road to lower power questions, many thanks for these new options.

It appears to me that with the prescaler options there potentially might be a possibility to lower the Vcc level even further (i.e. below 2.7V, maybe down to 1.8V, and thereby lowering power consumption) in case low frequencies are selected. This is hinted as well by the way you have implemented the new ZX-*t devices which only differ from the 5V versions in prescaler value only. This would apply in particular for those devices (like the ZX-328 variants) that do not have any other logic added? As far as I can see it this opportunity would then depend largely on the system clock configuration that is used by ZX devices: either the Low Power Oscillator or the Full Swing Oscillator (both use the XTAL1 and XTAL2 pins, it is just a matter of fuse configs), the latter requiring at least 2.7V according to the AtMega328p datasheet but the former does not have a minimum Vcc limit as it seems. Am I right in this, or does the fact that the main crystal frequency is fixed also sets the minimum Vcc level, irrespective of the prescaler value applied? In which way are the ZX devices configured regarding the beforementioned xtal oscillators?

PS1: A complicating factor are the brownout fuse settings. Are all devices set at 2.7V brownout?
PS2: in the documentation it is stated that Option Deviceparameter statements are only for Generic devices. Regarding the prescaler option, has an exception been made so that it applies to standard ZX devices as well?

Thks,
Jurjen

Posted: 02 March 2015, 7:19 AM
by dkinzer
kranenborg wrote:This is hinted as well by the way you have implemented the new ZX-*t devices which only differ from the 5V versions in prescaler value only.
The ZX-24t uses the divide-by-two prescaler to run at 7.37MHz (the units are manufactured with a 14.7MHz crystal and serve as the basis for the ZX-24r, ZX-24s and ZX-24t). On the other hand, the ZX-40t and ZX-44t just use a 7.37MHz crystal and the prescaler is set to divide-by-1 the same as for the ZX-328L and ZX-32L.
kranenborg wrote:Am I right in this, or does the fact that the main crystal frequency is fixed also sets the minimum Vcc level, irrespective of the prescaler value applied?
The operating frequency governs the minimum operating voltage. The operating frequency is the resulting frequency after the prescaler division. So on the ZX-24t, even though it has a 14.7MHz crystal, it can operate down to the brownout voltage of 2.7V because the prescaler reduces the operating frequency to 7.37MHz.
kranenborg wrote:In which way are the ZX devices configured regarding the beforementioned xtal oscillators?
All ZX devices are configured for full-swing oscillator and a brownout level of 2.7V.
kranenborg wrote:PS2: in the documentation it is stated that Option Deviceparameter statements are only for Generic devices.
Thanks for mentioning this. Most DeviceParameter directives are for generic devices only but Prescaler is allowed for ZX devices.

Re: New Compiler Release, New Devices

Posted: 18 November 2023, 2:07 AM
by kranenborg
Hi All,

I have used the ClockPrescaler option to save power with success. In many cases the ZX-device's default speed is unnecessarily high, often the device's main advantage to me is the ZBASIC language expressiveness.

However, a too high prescaler factor may lead to a loss of connection with the device over the programming cable (although it continues to run the application as is should at very low power). Initially my impression was that the device was "bricked" and stuck to the latest downloaded program.
A simple way to get it back to life then for re-programming is to apply power on the device only immediately AFTER you have sent the Go command (for downloading a new program). This did the trick for me as a program download try is likely one of the first things your ZX-device does before it does anything else (including the prescaler operation that caused the loss of responsiveness).

So the prescaler option is fully usable, and the device should remain re-progammable in all cases.

/Jurjen

Re: New Compiler Release, New Devices

Posted: 23 January 2024, 14:41 PM
by dkinzer
That's an interesting observation. Thanks.