-
Notifications
You must be signed in to change notification settings - Fork 2
Comms: AGC + RX Fixes for Radio #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoever is testing this (I assume @ChromeUniverse ), please post results in any form on the PR
| self.readRegister(_SX126X_REG_AGC_RSSI_MEAS_CAL_L, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_RSSI_MEAS_CAL_L: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_1_2, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_1_2: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_3_4, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_3_4: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_5_6, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_5_6: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_7_8, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_7_8: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_9_10, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_9_10: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_11_12, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_11_12: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_13, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_13: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_G_FORST_POW_THR, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_G_FORST_POW_THR: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_RX_GAIN, temp_mv, 1) | ||
| print(f"_SX126X_REG_RX_GAIN: {temp[0]}") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the prints before merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the call to this function. The function should be kept for debugging if ever needed for modifications to this whole business.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, this is not enough; I would remove the prints or comment them out. Can't make any assumption on the external function usage or that it won't be used, so need to take the precaution here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything under flight/ should be print sanitized @ChromeUniverse honestly
And honestly this belongs to scripts/ instead of the hal
| self.readRegister(_SX126X_REG_AGC_RSSI_MEAS_CAL_L, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_RSSI_MEAS_CAL_L: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_1_2, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_1_2: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_3_4, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_3_4: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_5_6, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_5_6: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_7_8, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_7_8: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_9_10, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_9_10: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_11_12, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_11_12: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_13, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_13: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_G_FORST_POW_THR, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_G_FORST_POW_THR: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_RX_GAIN, temp_mv, 1) | ||
| print(f"_SX126X_REG_RX_GAIN: {temp[0]}") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, this is not enough; I would remove the prints or comment them out. Can't make any assumption on the external function usage or that it won't be used, so need to take the precaution here
| self.readRegister(_SX126X_REG_AGC_RSSI_MEAS_CAL_L, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_RSSI_MEAS_CAL_L: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_1_2, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_1_2: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_3_4, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_3_4: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_5_6, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_5_6: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_7_8, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_7_8: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_9_10, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_9_10: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_11_12, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_11_12: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_GAIN_TUNE_13, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_GAIN_TUNE_13: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_AGC_G_FORST_POW_THR, temp_mv, 1) | ||
| print(f"_SX126X_REG_AGC_G_FORST_POW_THR: {temp[0]}") | ||
|
|
||
| temp = bytearray(1) | ||
| temp_mv = memoryview(temp) | ||
|
|
||
| self.readRegister(_SX126X_REG_RX_GAIN, temp_mv, 1) | ||
| print(f"_SX126X_REG_RX_GAIN: {temp[0]}") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything under flight/ should be print sanitized @ChromeUniverse honestly
And honestly this belongs to scripts/ instead of the hal
A (potential) software fix to the RX nonsense we have been seeing on comms for the last couple of weeks.
Implements AGC configuration according to the datasheet for the SX1262:

AGC is unconfigured in both the E22 and RFM9x drivers. However, it seems the AGC for the SX1262 (E22-400M-30S) is default configured for 915 MHz, and the SX1276 (RFM98PW) is configured for 434 MHz. This probably explains why the RFM98PW worked for previous missions.