Pin difference Lopy / Lopy4 -> minus one io on the lopy4?
Just realized that the pinout on the Lopy4 is slightly different to the one of the Lopy. On the Lopy an internal pin (25) is used to control the wifi antenna switch whereas on the Lopy4 it is an external pin (42 alias P12).
I guess P12 on the Lopy4 should not be used to connect anything else. Thus the lopy4 has one io less than the lopy. What is the reasoning behind that?
this.wiederkehr last edited by this.wiederkehr
For completness one might also mention that there are another pins which should be used with care:
- MTDI / P9 is the ESP strapping pin to select the voltage of the internal LDO.
- MTDO / P4 is the ESP strapping pin for debug logging during boot
- GPIO2 / P8 (together with PIO0) is the ESP strapping pin to select boot mode
- GPIO5 / Sigfox CLK (together with MTDO) is the ESP strapping pin to select SDIO Timing
@robert-hh The problem is that this pin can no longer be used as an input. That makes LoPy4 not FFF compatible with LoPy. I had already planned on throwing out all of the LoPy devices due to the memory limitations but now I have to throw out or rework all of my base boards. No way to do a field updates on installed units either.
@this-wiederkehr Not really. Since it is already a bootstrap input pin, I use it as an input interrupt with a button attached on my devices. That way I can get multiple functions from 1 button. Now I need 2 buttons to get the same functionality.
@ssmith P12 is checked for safe boot only at boot time. It is therfore safe to use it as an output, as long as the external connections do not pull it up. This property limited it's us anyhow.
There is an advantage with this change: the selection of the antenna can now also be done from outside.
Ah, I see P12 also is used to select the boot mode as well. That is probably the reason for using it as the antenna switch selector. Reasoning: you should not use that pin for anything else anyway ...?
Also, the LoRa antenna connector moved. Is there any documentation on all of the differences, both HW and SW, between the LoPy and LoPy4. This is not just a drop in replacement.
@this-wiederkehr Thanks for that. One less problem I have to track down. Still trying to get this to run my code. machine.sleep seems to freeze my board right now even though I can run it from REPL.
It seems like a bad idea to me that this pin is used as an output on the board but is also the safe boot pin. Hopefully it is set up as an open drain. Looks like a PCB redesign is in my near future.
Glad I could help :-P
I really wonder why this is done. Every other pin of the esp32 is used but not pin 25 which seems now to be free ...
I also see that it's the same on all new boards wipy 3.0, gpy, fipy and the lopy4.
Well that would explain why my WiFi doesn't work very well. I use that pin as an input.