You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There were two errors in calculations of LFXO INTCAP code:
- The value provided by DTS files is internal desired capacitance.
The value from DTS has to be "encoded" before use in INTCAP
calculations formula. The formula for encoding is:
CAPACITANCE_CODE = (<desired_value> - 4pF) / 0.5
Subtract of 4 is related with lowest value in the allowed range.
Division by 0.5 is related with change to steps size.
In former code the subtration of 4pF was missing.
- The mid_val calcuation was wrong due offset_k left shift by 4.
It should be left shift by 3 to get total left shift of 9.
That matches the left shift of former part of the equation.
Final integer value was calculated by right shift 10, it should
be right shift 9. Then rounding was done by use of mod by (1 << 10)
It should be mod by (1 << 9) and compared with (1 << 8), that is
half of 0-512 range.
Upstream PR: zephyrproject-rtos/zephyr#74668
Signed-off-by: Piotr Pryga <[email protected]>
0 commit comments