Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

VOC algorithm SGP40 on 8-bit MCU issues #124

Closed
jirihusak opened this issue Dec 14, 2020 · 3 comments
Closed

VOC algorithm SGP40 on 8-bit MCU issues #124

jirihusak opened this issue Dec 14, 2020 · 3 comments

Comments

@jirihusak
Copy link

Hi,
I'm testing a library for SGP40 and I spent lot of time debuging, why the voc algorithm working on PC but not working on 8-bit MCU (Michrochip PIC18).

The issue is in file
function : static fix16_t fix16_mul(fix16_t inArg0, fix16_t inArg1)
when is at least one parameter negative, than the multiply overflow and returns unexpected result.
I make quick fix and in the algorithm I'm working only with positive numbers
->1. chceck if the result should be positive or negative
->2. both of arguments make positive (abs() )
->3. if result should be negative, return -ret_val;

@abrauchli
Copy link
Contributor

Hi @jirihusak many thanks for taking the time to debug and report this! We'll investigate the issue and possibly import your fix. Note that due to the holidays it will likely drag into next year. We'll leave this issue open until then.

Kind regards and merry Christmas 🎅
Andreas

@MBjoern
Copy link
Contributor

MBjoern commented Apr 6, 2021

Hi, We're working on a fix for this issue and will publish an updated version for 8bit MCUs soon.

Thank you for your patience

@MBjoern
Copy link
Contributor

MBjoern commented May 7, 2021

Hi jirihusak

We have updated the VOC algorithm to fix the 8-bit mcu fix point aritmetic issue.
Would you mind testing the updated version (release 7.1.2) and update us, if the mentioned issue can be resolved?

Best regards
Björn

@MBjoern MBjoern closed this as completed Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants