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

Wrong register in setDataShapingOOK? #110

Closed
sjd227 opened this issue Feb 7, 2020 · 4 comments
Closed

Wrong register in setDataShapingOOK? #110

sjd227 opened this issue Feb 7, 2020 · 4 comments
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)

Comments

@sjd227
Copy link

sjd227 commented Feb 7, 2020

Why does setDataShapingOOK (sx1272.cpp, line 312) use the SX127X_REG_PA_RAMP register? Shouldn't it use SX127X_REG_OP_MODE instead, since that's where data shaping is set for both FSK and OOK?

Also could you please explain why you need to call this when enabling OOK? Why not stick with the default assignment (no shaping)?

Thanks!

  • Steven
@jgromes jgromes transferred this issue from jgromes/LoRaLib Feb 8, 2020
@jgromes
Copy link
Owner

jgromes commented Feb 8, 2020

I think you might be consfusing modulation type and data shaping - those are different things. Modulation type is the modulation that should be used for the transmission - FSK, OOK or LoRa. This is indeed set in SX127X_REG_OP_MODE.

However, in FSK and OOK, you also have the option to specify output filter for the signal, either Gaussian with different bandwidth-time products (in FSK), or low pass with different cutoff frequencies (in OOK). Those are in the register named SX127X_REG_PA_RAMP - I suggest consulting the datasheet.

Also could you please explain why you need to call this when enabling OOK?

You don't have to call setDataShapingOOK to use OOK, just as you don't have to call setDataShaping to use FSK - if you don't call it, the module will simply keep the previous data shaping configuration.

@jgromes jgromes closed this as completed Feb 8, 2020
@jgromes jgromes added the question Generic question about code or usage label Feb 8, 2020
@sjd227
Copy link
Author

sjd227 commented Feb 8, 2020

The datasheet shows ModulationShaping (which specifies the gaussian filters for FSK and frequency cutoffs for OOK) set to bits 4-3 of the RegOpMode register though. Plus RegPaRamp uses bits 0-3, 4, and 7-5, so not sure why setDataShapingOOK would be assigning bits 4-3 on this. See datasheet snippets attached.

sx1272-datasheet-screenshot-regparamp

sx1272-datasheet-screenshot

@jgromes
Copy link
Owner

jgromes commented Feb 8, 2020

Ah, I was looking at the SX1278 datasheet and implementation - that one is correct. You're right, on SX1272 data shaping is in SX127X_REG_OP_MODE.

@jgromes jgromes reopened this Feb 8, 2020
@jgromes jgromes added bug Something isn't working and removed question Generic question about code or usage labels Feb 8, 2020
@jgromes
Copy link
Owner

jgromes commented Feb 8, 2020

Should be fixed now, thanks for reporting!

@jgromes jgromes closed this as completed Feb 8, 2020
@jgromes jgromes added the resolved Issue was resolved (e.g. bug fixed, or feature implemented) label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)
Projects
None yet
Development

No branches or pull requests

2 participants