Code Monkey home page Code Monkey logo

protocentral-afe4490-arduino's People

Contributors

aentinger avatar manikandan12345 avatar mohammedhm avatar protocentralashwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

protocentral-afe4490-arduino's Issues

[enhancement] Consider supporting both AFE4400 and AFE4490 register maps/values via #def

The AFE4400 and AFE4490 have different setup register values since the 4400 is a feature subset of the 4490.
A good enhancement would be to have a #define for which chip to compile for and appropriately choose the correct register value set in

afe44xxWrite(CONTROL0, 0x000000);
afe44xxWrite(CONTROL0, 0x000008);
afe44xxWrite(TIAGAIN, 0x000000); // CF = 5pF, RF = 500kR
afe44xxWrite(TIA_AMB_GAIN, 0x000001);
afe44xxWrite(LEDCNTRL, 0x001414);
afe44xxWrite(CONTROL2, 0x000000); // LED_RANGE=100mA, LED=50mA
afe44xxWrite(CONTROL1, 0x010707); // Timers ON, average 3 samples
afe44xxWrite(PRPCOUNT, 0X001F3F);
afe44xxWrite(LED2STC, 0X001770);
afe44xxWrite(LED2ENDC, 0X001F3E);
afe44xxWrite(LED2LEDSTC, 0X001770);
afe44xxWrite(LED2LEDENDC, 0X001F3F);
afe44xxWrite(ALED2STC, 0X000000);
afe44xxWrite(ALED2ENDC, 0X0007CE);
afe44xxWrite(LED2CONVST, 0X000002);
afe44xxWrite(LED2CONVEND, 0X0007CF);
afe44xxWrite(ALED2CONVST, 0X0007D2);
afe44xxWrite(ALED2CONVEND, 0X000F9F);
afe44xxWrite(LED1STC, 0X0007D0);
afe44xxWrite(LED1ENDC, 0X000F9E);
afe44xxWrite(LED1LEDSTC, 0X0007D0);
afe44xxWrite(LED1LEDENDC, 0X000F9F);
afe44xxWrite(ALED1STC, 0X000FA0);
afe44xxWrite(ALED1ENDC, 0X00176E);
afe44xxWrite(LED1CONVST, 0X000FA2);
afe44xxWrite(LED1CONVEND, 0X00176F);
afe44xxWrite(ALED1CONVST, 0X001772);
afe44xxWrite(ALED1CONVEND, 0X001F3F);
afe44xxWrite(ADCRSTCNT0, 0X000000);
afe44xxWrite(ADCRSTENDCT0, 0X000000);
afe44xxWrite(ADCRSTCNT1, 0X0007D0);
afe44xxWrite(ADCRSTENDCT1, 0X0007D0);
afe44xxWrite(ADCRSTCNT2, 0X000FA0);
afe44xxWrite(ADCRSTENDCT2, 0X000FA0);
afe44xxWrite(ADCRSTCNT3, 0X001770);
afe44xxWrite(ADCRSTENDCT3, 0X001770);
delay(1000);

Currently, the file is named as protocentral_afe44xx.cpp but contains invalid register values for the AFE4400.

[bug] Timing controls violate deadbands as mentioned in the AFE4400 datasheet. Result in noisy and therefore incorrect readings.

As mentioned, the timing scheme violates the 2x 4HMz clock cycle deadbands.
Snip from AFE4400 Datasheet:
image

Example violations:

afe44xxWrite(ADCRSTCNT0, 0X000000);

afe44xxWrite(ADCRSTENDCT0, 0X000000);

These need to be at least 2 clock cycles apart.

Resulting data:
image

Image from Protocentral blog shows cleaner data, so likely that the timing scheme needs updating on GitHub.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.