MOD-MRF24J40

Материал из Wiren Board
Это утверждённая версия страницы. Она же — наиболее свежая версия.
Другие языки:


IEEE 802.15.4 transceiver module from Olimex. Contains a chip of Microchip MRF24J40. The module can be bought in the Olimex store.


Is inserted into the connector UEXT uses the SPI interface.


IEEE 802.15.4

IEEE 802.15.4 is a physical layer that is used by ZigBee, 6LoWPAN, and other standards. Linux supports the standard 6LoWPAN - IPv6 network over the physical layer. Operating frequency - 2.4 Ghz, unlicensed range.


Support for 6LoWPAN on Linux is currently not fully functional. http://elinux.org/images/7/71/Wireless_Networking_with_IEEE_802.15.4_and_6LoWPAN.pdf

Connection

The module is connected to the Wiren Board controller via the UEXT2 connector. Pins 6-7 (program I2C) are used in GPIO mode.

For Linux, you must use the INT interrupt output. In the module's UEXT connector, this signal is routed to the UART RX (4) pin, which makes it impossible to use it as an interrupt source. You need to connect the INT pin on the findings UEXT2, which is essentially a GPIO, for example on pin 6 UEXT2 (GPIO53).

The easiest way to do this is to short-circuit (e.g. solder) the legs 4 and 6 on the UEXT plug of the module.

Settings

The driver of the transceiver in the kernel [1]. Minor changes were added to the driver to operate in half-duplex mode for SPI and in Device Tree. The driver is included in the default image as a module.

To connect the module, you must declare the device in Device Tree/en:

ssp1: ssp@80034000 {
 ..............

        cs-gpios = <&gpio0 17 0
		   &gpio2 28 0
		   &gpio1 20 0
		   &gpio2 27 0 /* 91 	25 @ CON2 	UEXT2 CS/GPIO */    <-------- Chip Select of UEXT2 connector corresponds to device number 6(2+4)
	          >;


    ........

	6lowpan@0 {
		compatible = "microchip,mrf24j40";
		spi-max-frequency = <100000>;
		reg = <6>;
		interrupt-parent = <&gpio1>;  <--------  use GPIO 53 (21 + 32) в качестве IRQ
		interrupts = <21 0>;          <--------  It corresponds to output number of the 6 of the UEXT2 connector
	};


                        ........


};


Working with 6LoWPAN

Install packages to work with 6LoWPAN:

apt-get install  lowpan-tools


Work with 6LoWPAN is performed using the utility iz

root@wirenboard:~# iz listphy
wpan-phy0  IEEE 802.15.4 PHY object
    page: 0  channel: n/a
    channels on page 0: 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


You need the lowpan-tools package from sid to work

Ссылки