Skip to content

Commit 3ace013

Browse files
committed
updated content
1 parent dba4e56 commit 3ace013

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

docs/basics/06-wireless.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The WiFi chip used is the [Infineon CYW43439](https://www.infineon.com/cms/en/pr
1010

1111
![Wireless Block Architecture](../img/wireless-block-arch.png)
1212

13+
You can read more about the capabilities of the WiFi/Bluetooth chip by reading the [Infineon CYW43439 Datasheet](https://www.infineon.com/dgdl/Infineon-CYW43439-Single-Chip-IEEE-802.11-b-g-n-MAC-PHY-Radio-with-Integrated-Bluetooth-5.0-Compliance-AdditionalTechnicalInformation-v03_00-EN.pdf?fileId=8ac78c8c7ddc01d7017ddd033d78594d)
14+
1315
## Compatibility with Prior Code
1416

1517
The Pico W code is very similar to prior versions of the Pico with a few small exceptions. One of these is the fact that we must now use a symbolic label called an **alias* such as ```Pin("LED")``` instead of ```Pin(25)``` to access the LED pin, not a hardwired PIN number. This allows us to keep our code more portable as the underlying hardware changes.
@@ -292,35 +294,40 @@ You can get the device MAC/Ethernet address and test the roundtrip time between
292294

293295
```py
294296
import network
295-
import secrets
296297
from utime import sleep, ticks_us, ticks_diff
297298

298299
print('Getting MAC/Ethernet Address for this device.')
299300

300301
start = ticks_us() # start a millisecond counter
301302
wlan = network.WLAN(network.STA_IF)
302303

303-
# This returns a byte array
304+
# This returns a byte array of hex numbers
304305
mac_addess = wlan.config('mac')
305306
print('Time in microseconds:', ticks_diff(ticks_us(), start))
306307
# each MAC address is 6 bytes or 48 bits
307-
print("Hex:", mac_addess)
308+
print("Hex byte array:", mac_addess, 'length:', len(mac_addess))
308309

309-
# b'(\x c d \x c 1 \x 0 1 5X'
310+
# This should be in hex per the Notational Conventions
311+
# https://en.wikipedia.org/wiki/MAC_address#Notational_conventions
312+
# b'(\xcd\xc1\x015X'
313+
# 28:cd:c1:1:35:58
314+
# format in MAC Notational Convention
310315
for digit in range(0,5):
311-
print(mac_addess[digit], ':', sep='', end = '')
312-
print(mac_addess[5])
316+
print(str(hex(mac_addess[digit]))[2:4], ':', sep='', end = '')
317+
print(str(hex(mac_addess[5]))[2:4] )
313318
```
314319

315320
Results:
316321
```
317322
Getting MAC/Ethernet Address for this device.
318-
Time in microseconds: 216
319-
Hex: b'(\xcd\xc1\x015X'
320-
40:205:193:1:53:88
323+
Time in microseconds: 211
324+
Hex byte array: b'(\xcd\xc1\x015X' length: 6
325+
28:cd:c1:1:35:58
321326
```
322327

323-
I ran this program on my Pico W and I got times of between 214 and 222 microseconds. This shows you that it takes about 100 microseconds to send a request from the RP2040 to the WiFi chip and about 100 milliseconds to return the results. This time lag represents some of the key performance limitations in using the Pico W for high-performance networking.
328+
The MAC address is six bytes or "octets". The first three octets are assigned to the organization that created the device. The second three octets are assigned by the organization that created the device. See the [Wikipedia Page on MAC Address](https://en.wikipedia.org/wiki/MAC_address) for more information. If you run this on your Pico W the first octets should be similar.
329+
330+
I ran this program on my Pico W and I got times of between 214 and 222 microseconds. This shows you that it takes about 100 microseconds to send a request from the RP2040 to the CYW43439 WiFi chip and about 100 milliseconds to return the results. This time lag represents some of the key performance limitations in using the Pico W for high-performance networking.
324331

325332
## Using the Pico W as a Web Server
326333

0 commit comments

Comments
 (0)