jgromes / RadioLib

Universal wireless communication library for embedded devices
https://jgromes.github.io/RadioLib/
MIT License
1.54k stars 384 forks source link

SX1272 reset pin inverted #124

Closed sjd227 closed 4 years ago

sjd227 commented 4 years ago

Looking at the sx1272 datasheet, it looks like reset is done by pulling the reset pin HIGH for 100 microseconds, then releasing it LOW:

sx1272_reset_snip

But in sx127x.cpp it seems reversed:

void SX127x::reset() {
     Module::pinMode(_mod->getRst(), OUTPUT);
     Module::digitalWrite(_mod->getRst(), LOW);
     delayMicroseconds(100);
     Module::digitalWrite(_mod->getRst(), HIGH);
     delay(5);
}

Thoughts?

jgromes commented 4 years ago

It looks like SX1272 has a positive-logic reset (RST=1 to reset), while SX1278 has negative logic (NRST=0 to reset). The current implementation will work for for SX1276/77/78/79, though not for SX1272/73. Will fix asap.

jgromes commented 4 years ago

Fixed in c1c991acc831cbb457cf96037eb9cf4ced261a6f, will release the fix as 3.4.0. Thanks for reporting!

sjd227 commented 4 years ago

Sounds good, thanks!

naggie commented 4 years ago

This explains a lot. Thanks @sjd227 and @jgromes . Definitely encountered this