181
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
The clock frequency affects all aspects of device operation that rely on this clock.
Naturally, program execution speed depends on the clock frequency. Additionally,
the baudrates of the
property)
depend on the main clock. Finally, the frequency of the square wave generated by
the
object depends on the main clock as well.
object has a
read-only property and
method. See
topic- it explains how to switch PLL
on and off.
) the DS1206 boots with the PLL on or
off depending on the state of the PE pin.
For the serial port, there is a way to set the baudrate in the clock-independent
(and, actually, platform-independent) way -- see
property for
details (example of use can be found in the
topic). For the beep
object, you just have to set the
correctly depending on the value
returned by the sys.currpll property.
Data in the special configuration section of the EEPROM
Bottom 8 bytes of the EEPROM (accessible through the
object) are reserved
for storing a MAC address of the device. On power-up, the MAC address is read out
from the EEPROM and programmed into the Ethernet controller. You can always
check current MAC through the
read-only property of the
object
but there is no direct way to change it. Instead, you can change the MAC address
data in the EEPROM. Then, next time the device boots up it will start using this
new address.
By default, the area storing MAC address is not accessible to your application- the
property takes care of that. Unless you change it, this property
specifies that your application's storage area starts at address 9 (counting from 1).
To change MAC, set the stor.base to 1.
MAC address data in the EEPROM has a certain formatting -- you have to follow it
if you want the MAC to be recognized by the firmware (TiOS). Here is the format:
Byte1
Byte2
Byte3
Byte4
Byte5
Byte
6
Byte7
Byte8
6
MAC0
MAC1
MAC2
MAC3
MAC
4
MAC5
Checksum
Byte at address 1 must be set to 6- this means, that 6 byte of data follow (MAC
address consists of 6 bytes). Addresses from 2 to 7 carry actual MAC data. Address
8 stores the checksum, which is calculated like this:
255-(modulo8_sum_of_addr_1_through_7)
Here is a sample code that stores new MAC address into the EEPROM and then
reboots the device to make the device load this new MAC:
224
248
387
212
218
219
215
222
250
224
388
380
269
267
381