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

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

Open
yashmulgaonkar opened this issue Feb 3, 2023 · 0 comments

Comments

@yashmulgaonkar
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant