MOD-MRF24J40

Версия от 19:53, 18 июля 2019; RomanKulibaba (обсуждение | вклад) (Новая страница: «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.»)

Другие языки:


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.

Настройка

Драйвер трансивера в ядре [1]. В драйвер добавлены незначительные изменения для работы в полудуплексном режиме SPI и для использования Device Tree. Драйвер в виде модуля включен в образ по-умолчанию.

Для подключения модуля, необходимо объявить устройство в Device Tree:

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 разъёма UEXT2 соответствует устройству номер 6 (2+4)
	          >;


    ..............

	6lowpan@0 {
		compatible = "microchip,mrf24j40";
		spi-max-frequency = <100000>;
		reg = <6>;
		interrupt-parent = <&gpio1>;  <--------  используем GPIO 53 (21 + 32) в качестве IRQ
		interrupts = <21 0>;          <--------  Это соответствует выводу 6 разъёма UEXT2
	};


                        ..............


};


Работа с 6LoWPAN

Устанавливаем пакеты для работы с 6LoWPAN:

apt-get install  lowpan-tools


Работа с 6LoWPAN производится с помощью утилиты 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


Для работы необходим пакет lowpan-tools из sid

Ссылки