ADS1220 Library Modified from Sandeep Malladi
Dependents: ADS1220SPI BMI160Test Seismograph-Geodynamic
Revision 1:34692a3d25f7, committed 2016-10-13
- Comitter:
- firewalk
- Date:
- Thu Oct 13 02:07:10 2016 +0000
- Parent:
- 0:90cd7e5e24af
- Commit message:
- Modified by Celso Varella
Changed in this revision
ADS1220.cpp | Show annotated file Show diff for this revision Revisions of this file |
ADS1220.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 90cd7e5e24af -r 34692a3d25f7 ADS1220.cpp --- a/ADS1220.cpp Tue May 24 13:44:10 2016 +0000 +++ b/ADS1220.cpp Thu Oct 13 02:07:10 2016 +0000 @@ -18,7 +18,7 @@ // clear prev value; Temp &= 0x00; - Temp |= (ADS1220_MUX_2_3 | ADS1220_GAIN_128);//ADS1220_GAIN_128); + Temp |= (ADS1220_MUX_1_G | ADS1220_GAIN_1 | ADS1220_PGA_BYPASS);//MUX_AIN1, ADS1220_GAIN_1, PGA-BYPASS ON); // write the register value containing the new value back to the ADS WriteRegister(ADS1220_0_REGISTER, 0x01, &Temp); @@ -26,7 +26,7 @@ ReadRegister(ADS1220_1_REGISTER, 0x01, &Temp); // clear prev DataRate code; Temp &= 0x00; - Temp |= (ADS1220_DR_1000 | ADS1220_CC); // Set default start mode to 600sps and continuous conversions + Temp |= (ADS1220_DR_1000 | ADS1220_MODE_TURBO); // Set turbo start mode to 1000sps(2000 sps) and single shot conversions // write the register value containing the new value back to the ADS WriteRegister(ADS1220_1_REGISTER, 0x01, &Temp); @@ -36,7 +36,7 @@ // clear prev DataRate code; Temp &= 0x00; - Temp |= (ADS1220_VREF_EX_DED | ADS1220_REJECT_50); // Set Internal Vref as 2.048 V + Temp |= (ADS1220_VREF_SUPPLY | ADS1220_REJECT_OFF); // Set External Reference 5.00 V (AVDD - AVSS) // write the register value containing the new value back to the ADS WriteRegister(ADS1220_2_REGISTER, 0x01, &Temp); @@ -545,13 +545,13 @@ dERROR = SetChannel(Temp + ADS1220_MUX_3_2); break; case 8: - dERROR = SetChannel(Temp + ADS1220_MUX_0_G); + dERROR = SetChannel(Temp + ADS1220_MUX_2_G); break; case 9: dERROR = SetChannel(Temp + ADS1220_MUX_1_G); break; case 10: - dERROR = SetChannel(Temp + ADS1220_MUX_2_G); + dERROR = SetChannel(Temp + ADS1220_MUX_0_G); break; case 11: dERROR = SetChannel(Temp + ADS1220_MUX_3_G);
diff -r 90cd7e5e24af -r 34692a3d25f7 ADS1220.h --- a/ADS1220.h Tue May 24 13:44:10 2016 +0000 +++ b/ADS1220.h Thu Oct 13 02:07:10 2016 +0000 @@ -39,7 +39,7 @@ #define ADS1220_MUX_2_3 0x50 #define ADS1220_MUX_1_0 0x60 #define ADS1220_MUX_3_2 0x70 -#define ADS1220_MUX_0_G 0x80 +#define ADS1220_MUX_0_G 0x80 #define ADS1220_MUX_1_G 0x90 #define ADS1220_MUX_2_G 0xa0 #define ADS1220_MUX_3_G 0xb0