Closed floatAsNeeded closed 1 year ago
I dont see that there is an issue here, the 'default' OCP trim value is indeed 100mA, that is the reset value of the SX127x register.
The library TX routines, such as transmitSXBuffer() need the TXpower as a parameter by design, and set OCP trim appropriately before every transmission, so there is no need to set OCP trim in setupLoRa().
Use the printOCPTRIM() function after a transmission, what value do you see ?
You're right, the routine is done in the SX buffer anyway before transmitting. I do get the proper OCPTRIM after transmitting. Thank you for clarifying! I think the reason why my board was resetting was that I was not supplying enough power when transmitting, now I resolved that issue I was having, and nothing related to that.
I just wanted to note an issue regarding the library using an SX1276 that I was testing.
Basically, if you try the example code 8_LoRa_LowMemory_TX the OCP trim settings are by default at 100mA The only thing is that they don't change based on different TX settings.
The only way I found out (by seeing the cpp file) to let the settings change based on the TX power is by adding this line of code
LT.setTxParams(TXpower, RADIO_RAMP_DEFAULT);
I'm not sure if that is the behaviour intended by the library. Maybe when using setupLora, it should also have the routine done with setTxParams to modify the OCP trim settings based on TX power. Maybe something like this:
I believe they are essential settings when using higher power like 17dbm to ensure output power and in general best practices from the datasheet. I had an issue with the module resetting that is how I find out that the OCP settings were not changing when using different TX power but were always stuck in 100mA regardless of TX power. I used LoRa.printOCPTRIM(); and I was always getting:
REG_OCP,2B,OCP_TRIM_100MA