SNR calculation error

Open
#18 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
embedded-iot

Research direction

Start by locating the LLCC68 GetPacketStatus implementation and the SNR calculation that reads register value 0x14. Compare its type handling with the LLCC68 data manual's two's-complement description. Done means poor signals produce negative SNR values close to the expected range instead of positive values around 45 to 48.

Written by the indexing model from the issue text.

Description

Version

main

Describe the bug

When I was using the LLCC68 module, the distance between the master and slave modules was quite far. During the calculation of the SNR value, abnormal values appeared. The current value should be a negative number (close to -20), but the calculated SNR value is a positive number (45 to 48).

Reproduce

When the signals between the modules are poor, calculate the SNR value.

Expected behavior

When the signal is very poor, the calculated value of SNR should be a negative number.

Additional context

After reading the LLCC68 data manual, I suspect that there is an error in the calculation performed by the GetPacketStatus register with the value of 0x14 when reading the data. The original text of the manual reads: "Estimate the SNR of the last received packet in two's complement format and multiply it by 4. The actual SNR in dB = SnrPkt / 4." The SNR calculation value here still uses uint8_t, but in reality, int8_t should be used instead.

Dominant language
C
Stars
95
Forks
27
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libdriver/llcc68

All issues in libdriver/llcc68

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.