[riot-notifications] [RIOT-OS/RIOT] Add support for "External PA/LNA Control" in mrf24j40 driver (useful … (#10625)

benpicco notifications at github.com
Thu Apr 4 12:21:19 CEST 2019


Ok, I think now I understand the part about the GPIOs:

MRF24J40MC contains a voltage regulator for the PA that is controlled by GPIO3. GPIO[0, 1, 2] control the Power Amplifier and Low Noise Amplifier and are configured automatically when writing 0b111 to the TESTMODE register.

So always configuring GPIO3 (0b1000) to output high should not hurt on the non-C modules as that pin is simply not connected.

However it should be set to low in `mrf24j40_sleep()` and enabled again in `mrf24j40_assert_awake()`as it will otherwise consume more power than necessary.

GPIO0 and GPIO1 (which control tha PA) are disabled during CCA. The data sheet says:

> ### 1.3.2 (1.4.2) Energy detection
> Before performing an energy detection (see Section 3.6.1 “RSSI Firmware Request (RSSI Mode 1)” in the “MRF24J40 Data Sheet” (DS39776)), perform the following steps:
> 1. Configure the internal RF state machine to normal operation (TESTMODE (0x22F<2:0>) = 000).
> 2. Configure GPIO2 and GPIO1 direction for output (TRISGP2 (0x34<2>) = 1 and TRISGP1 (0x34<1>) = 1).
> 3. Set GPIO2 (0x33<2>) = 1 and GPIO1 (0x32<1>) = 0. This enables the LNA and disables the PA

For Sleep it says:

> ### 1.3.3 (1.4.3) Sleep
> To get the lowest power consumption from the MRF24J40MC module during Sleep, it is necessary to disable the PA, PA voltage regulator and LNA. To do this, perform the following steps: 
> 1. Configure the internal RF state machine to normal operation (TESTMODE (0x22F<2:0>) = 000).
> 2. Configure the GPIO3, GPIO2 and GPIO1 direction for output (TRISGP3 (0x34<3>) = 1, TRISGP2 (0x34<2>) = 1 and TRISGP1 (0x34<1>) = 1).
> 3. Set GPIO2 (0x33<2>) = 0 and GPIO1 (0x32<1>) = 0. This disables the LNA and the PA.
> 4. Set GPIO3 (0x33<3>) = 0. This shuts down the voltage regulator U5 that supplies 2.2 volts to
the PA.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10625#issuecomment-479839962
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190404/a2ad4d8a/attachment.html>


More information about the notifications mailing list