Running on Arduino UNO
Closed this issue · 4 comments
Hi,
When I compile it for Arduino UNO,
I got this error
21:35:24.546 -> begin
21:35:24.546 -> debugPrint=1
21:35:24.546 -> SX126x_SPI_SELECT=10
21:35:24.546 -> SX126x_RESET=9
21:35:24.546 -> SX126x_BUSY=2
21:35:24.546 -> SX126x_TXEN=-1
21:35:24.546 -> SX126x_RXEN=-1
21:35:24.581 -> Reset
21:35:24.581 -> ReadRegister: REG=0x740 DataIn: 0 84
21:35:24.581 -> syncWord=0x84
21:35:24.581 -> SX126x error, maybe no SPI connection
0x84 is SX126X_CMD_SET_SLEEP.
I use the following PIN configs:
SX126x lora(10, //Port-Pin Output: SPI select
0xff, //Port-Pin Output: Reset
2 //Port-Pin Input: Busy
);
The initial value of syncWord for this module is 0x1424.
21:35:24.581 -> syncWord=0x84
It indicates that the syncWord cannot be read correctly.
SPI communication may not be performed correctly.
I use the following PIN configs:
0xff, //Port-Pin Output: Reset
This is incorrect.
SX126x lora(5, //Port-Pin Output: SPI select
6, //Port-Pin Output: Reset
7 //Port-Pin Input: Busy
);
Wireing
Ra-01S/SH | UNO | MEGA | ESP8266 | |
---|---|---|---|---|
VCC | -- | 3.3V(*1) | 3.3V | 3.3V |
GND | -- | GND | GND | GND |
SCK | -- | D13(*2) | D52(*2) | IO14 |
MISO | -- | D12 | D50 | IO12 |
MOSI | -- | D11(*2) | D51(*2) | IO13 |
NSS | -- | D5(*2) | D5(*2) | IO2 |
RST | -- | D6(*2) | D6(*2) | IO0 |
BUSY | -- | D7(*2) | D7(*2) | IO16 |
(*1)
UNO's 3.3V output can only supply 50mA.
In addition, the output current capacity of UNO-compatible devices is smaller than that of official products.
So this module may not work normally when supplied from the on-board 3v3.
(*2)
SX126x is not 5V tolerant.
You need level shift from 5V to 3.3V.
Thanks, I don't use RESET Pin to save pin and it works on ESP32 testinng. Is this fine because I only want to transmit data from sensor only.
If the RESET pin is not used, do not connect a wire to RESET.
If you don't connect the wire, no RESET will be sent.
Thanks
I use Atmega16a instead and it works. it's way much cheaper than atmega328.