507
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Configuring Interface Lines
The Wi-Fi module interacts with your BASIC-programmable module through an SPI
interface. The SPI interface has four signals: chip select (CS), clock (CLK), data in
(DI), and data out (DO). Any four I/O lines of your programmable module can be
selected to control the SPI interface. Choosing I/O lines for the job is called
"mapping". The CS, CLK, and DO lines must be configured as outputs, and the DI
line will be an input:
'configure the CS line
wln.csmap=WLN_CS
io.num=WLN_CS
io.enabled=YES
'configure the DI line
wln.dimap=WLN_DI
'configure the DO line
wln.domap=WLN_DO
io.num=WLN_DO
io.enabled=YES
'configure the CLK line
wln.clkmap=WLN_CLK
io.num=WLN_CLK
io.enabled=YES
Note that mapping can't be changed when the Wi-Fi hardware is already
(i.e.
= 1- YES).
Setting MAC Address (Optional)
Every network interface needs its own MAC, and the Wi-Fi port is no exception.
The
property exists for this purpose. Your Wi-Fi module already carries
a MAC address onboard -- it is preset during manufacturing, so you don't actually
have to take care of the MAC. Leave the wln.mac at its default pre-boot value of
"0.0.0.0.0.0",
the Wi-Fi interface (
), and the wln.mac will be
updated with the pre-assigned address that is stored inside the Wi-Fi module.
You can use another MAC if you want, too. Set the desired MAC address before
booting up the Wi-Fi, and this MAC will be used instead of the pre-assigned one.
That is, if wln.boot is called after you set the wln.mac to anything but
"0.0.0.0.0.0", then your MAC will be used instead:
'set the mac address
wln.mac="0.1.2.3.100.200"
'override pre-assigned MAC with another address
...
romfile.open("ga1000fw.bin")
wln.boot(romfile.offset)
'the hardware will start using your MAC
The pre-assigned MAC inside the Wi-Fi module will not be altered. It is always
there and can be called up by leaving the wln.mac at "all zeroes", then booting the
Wi-Fi hardware.
508
519
520
508
515