ADS1220 Library Modified from Sandeep Malladi

Dependents:   ADS1220SPI BMI160Test Seismograph-Geodynamic

Revision:
1:34692a3d25f7
Parent:
0:90cd7e5e24af
--- 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);