Skip to content
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

Make it possible to define TCXO and XTAL radio modules within one variant #4492

Merged
merged 6 commits into from
Aug 20, 2024

Conversation

Nestpebble
Copy link
Contributor

@Nestpebble Nestpebble commented Aug 18, 2024

This changes the way that the SX1262 is initialised, so that if it fails to initialise with the DIO3 voltage reference set, it will retry with the voltage set to zero. By this, there is no need to fully define whether the attached radio has TCXO or not during compile.

This is mainly for the pro-micro variant, but will work with other DIY boards or variants that come in both flavours. Potential candidates are the RP2040 modules, as there are some low-cost versions that utilise the same cheap modules.

Huge credit to Todd Herbert (@todd-herbert) for doing so much of the heavy lifting and heavy thinking associated with this. It would not have been possible to do this without you!

Add in TCXO_OPTIONAL variable for tcxoVoltage and a double-check for working in both modes.
Make a change to the tcxoVoltage setting so that TCXO_OPTIONAL works if defined.
Added define for TCXO_OPTIONAL and the tcxoVoltage variable.

Added detail on the compatible boards.
@thebentern
Copy link
Contributor

This is great! I think there are also TXCO variants in the TLoRA line that have required specific pio targets, so we can perhaps try this on them. Anytime we can consolidate, I'm on board.

@Nestpebble
Copy link
Contributor Author

Nestpebble commented Aug 18, 2024

This is great! I think there are also TXCO variants in the TLoRA line that have required specific pio targets, so we can perhaps try this on them. Anytime we can consolidate, I'm on board.

I think I've made this universal enough, so just adding #define TCXO_OPTIONAL to the variant should engage it. It's only for SX1262, but should work with SX126x boards, because thats where this particular switch lives. I did have a think about other variants, but I don't know enough about the PiPico etc.

Anyway, I'm calling this good enough for now.

@Nestpebble Nestpebble closed this Aug 18, 2024
@Nestpebble Nestpebble reopened this Aug 19, 2024
@Nestpebble
Copy link
Contributor Author

@thebentern I keep getting notifications on this. Do I need to do something to make it merge properly?

@thebentern thebentern merged commit ee9e46e into meshtastic:master Aug 20, 2024
3 of 15 checks passed
@S5NC
Copy link
Contributor

S5NC commented Sep 12, 2024

This is a good idea. Hopefully the radio initialisation always fails when there is no TCXO when expecting one, instead of succeeding and causing problems in later stages.

TCXO_OPTIONAL should have SX126X in the name as currently it is for that class of IC only. Supporting multiple hardware variants in one firmware file is always complex when they can differ in more than one way (radio IC, and TCXO presence).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants