update v1.0.0.4, use PIG from ppc3 file
authorPeter Li <a0220410@ti.com>
Fri, 7 Apr 2017 01:27:26 +0000 (09:27 +0800)
committerPeter Li <a0220410@ti.com>
Fri, 7 Apr 2017 01:27:26 +0000 (09:27 +0800)
factorytest.c
lib/libftc32.a
lib/libftc64.a
speaker_l.ftcfg
speaker_r.ftcfg
tas2557_ftc.h
tas2557_ftc_lib.h
tas2557dm_ftc.c

index 1723bf10162ff1ecd88c10e0c3585a04e66c8959..cd82ac8b52a77cd49286a52be062b3ab52305a79 100755 (executable)
@@ -46,6 +46,7 @@
 #define PPC3_RTVA            2460   // Rtva (K/W)
 #define PPC3_SYSGAIN         9.35   // System Gain (V/FS)
 #define PPC3_DEV_NONLIN_PER  1.5    // Device Non-linearity (%)
+#define PPC3_PIG                       1
 
 #define        DEV_A_I2C_ADDR           0x98
 #define        DEV_B_I2C_ADDR           0x9a
@@ -76,6 +77,7 @@ void InitFTCC(struct TFTCConfiguration *pFTCC)
        pFTCC->nTSpkCharDevA.nPPC3_RTVA = PPC3_RTVA;
        pFTCC->nTSpkCharDevA.nPPC3_SysGain = PPC3_SYSGAIN;
        pFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer = PPC3_DEV_NONLIN_PER;
+       pFTCC->nTSpkCharDevA.nPPC3_PIG = PPC3_PIG;
        pFTCC->nTSpkCharDevA.nDevAddr = DEV_A_I2C_ADDR;
        
        pFTCC->nTSpkCharDevB.nSpkTMax = SPK_T_MAX;
@@ -89,6 +91,7 @@ void InitFTCC(struct TFTCConfiguration *pFTCC)
        pFTCC->nTSpkCharDevB.nPPC3_RTVA = PPC3_RTVA;
        pFTCC->nTSpkCharDevB.nPPC3_SysGain = PPC3_SYSGAIN;
        pFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer = PPC3_DEV_NONLIN_PER;
+       pFTCC->nTSpkCharDevB.nPPC3_PIG = PPC3_PIG;
        pFTCC->nTSpkCharDevB.nDevAddr = DEV_B_I2C_ADDR;
 }
 
@@ -130,6 +133,7 @@ void ReadValue(struct TFTCConfiguration *pFTCC, struct TSPKCharData *pSpk, char
        if (!strcmp(pLine, "PPC3_RTVA")) {pSpk->nPPC3_RTVA = atof(pValue); return;};
        if (!strcmp(pLine, "PPC3_SYSGAIN")) {pSpk->nPPC3_SysGain = atof(pValue); return;};
        if (!strcmp(pLine, "PPC3_DEV_NONLIN_PER")) {pSpk->nPPC3_DevNonlinPer = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_PIG")) {pSpk->nPPC3_PIG = atof(pValue); return;};
        if (!strcmp(pLine, "RE_HI")) {pSpk->nReHi = atof(pValue); return;};
        if (!strcmp(pLine, "RE_LO")) {pSpk->nReLo = atof(pValue); return;};
        if (!strcmp(pLine, "DEV_ADDR")){        
@@ -156,6 +160,7 @@ void ftcc_print(struct TFTCConfiguration *pFTCC)
        printf(" SPKA PPC3_RTVA           = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTVA);
        printf(" SPKA PPC3_SYSGAIN        = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_SysGain);
        printf(" SPKA PPC3_DEV_NONLIN_PER = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer);
+       printf(" SPKA PPC3_PIG            = %f\n\r", pFTCC->nTSpkCharDevA.nPPC3_PIG);
        printf(" DEVA ADDR                = 0x%x\n\r", pFTCC->nTSpkCharDevA.nDevAddr);
        
        printf("Speaker B characterization data: \n\r");
@@ -170,6 +175,7 @@ void ftcc_print(struct TFTCConfiguration *pFTCC)
        printf(" SPKB PPC3_RTVA           = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTVA);
        printf(" SPKB PPC3_SYSGAIN        = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_SysGain);
        printf(" SPKB PPC3_DEV_NONLIN_PER = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer);
+       printf(" SPKB PPC3_PIG            = %f\n\r", pFTCC->nTSpkCharDevB.nPPC3_PIG);
        printf(" DEVB ADDR                = 0x%x\n\r", pFTCC->nTSpkCharDevB.nDevAddr);  
 
 }
index 991de3e6ebb67c77c466f9084db29b295b3b2897..0d85d4afc8417469b73fb206a24df2e08e379ca8 100644 (file)
Binary files a/lib/libftc32.a and b/lib/libftc32.a differ
index 29bec0930083ad28325a204cf050f29007ba5daa..3f2e2d9f9f1df669b00581513e7cae99c93404a5 100644 (file)
Binary files a/lib/libftc64.a and b/lib/libftc64.a differ
index 98b6e6a536f19931f43acd2d1127fc25d841b06c..ef8eccd1cc829d72cb345b043a11783eca26dbcf 100755 (executable)
@@ -6,7 +6,8 @@
 ; Comments: [Write Comments Here]\r
 \r
 ; FTC Settings\r
-CALIBRATION_TIME          = 6000     ; Duration (in ms) of calibration phase\r
+CALIBRATION_TIME          = 2000     ; Duration (in ms) of calibration phase\r
+CONVERGENCE_TIME          = 8000     ; Duration of F0 tracker stable\r
 DEV_ADDR                  = 98       ; I2C slave write addr for device A\r
 \r
 ; Obtained from Speaker Manufacturer\r
@@ -25,4 +26,5 @@ PPC3_RTM                  = 80.7     ; Rtm  (K/W)
 PPC3_RTVA                 = 1723     ; Rtva  (K/W)\r
 PPC3_SYSGAIN              = 9.35     ; System Gain (V/FS)\r
 PPC3_DEV_NONLIN_PER       = 1.5      ; Device Non-linearity (%)\r
-\r
+PPC3_PIG                  = 1       ; Refer to documentation\r
+FS_RATE                   = 48000   ; TAS2557-B Sample Rate\r
index a90476a73b3d2796c11fd47de37bab6fcb6b5540..a6b73292681edba5db672afdfa11d01b2c9aafde 100755 (executable)
@@ -6,7 +6,8 @@
 ; Comments: [Write Comments Here]\r
 \r
 ; FTC Settings\r
-CALIBRATION_TIME          = 6000     ; Duration (in ms) of calibration phase\r
+CALIBRATION_TIME          = 2000     ; Duration (in ms) of calibration phase\r
+CONVERGENCE_TIME          = 8000     ; Duration of F0 tracker stable\r
 DEV_ADDR                  = 9a       ; I2C slave write addr for device B\r
 \r
 ; Obtained from Speaker Manufacturer\r
@@ -24,4 +25,6 @@ PPC3_RTV                  = 44.9     ; Rtv (K/W)
 PPC3_RTM                  = 80.7     ; Rtm  (K/W)\r
 PPC3_RTVA                 = 1723     ; Rtva  (K/W)\r
 PPC3_SYSGAIN              = 9.35     ; System Gain (V/FS)\r
-PPC3_DEV_NONLIN_PER       = 1.5      ; Device Non-linearity (%)
\ No newline at end of file
+PPC3_DEV_NONLIN_PER       = 1.5      ; Device Non-linearity (%)\r
+PPC3_PIG                  = 1       ; Refer to documentation\r
+FS_RATE                   = 48000   ; TAS2557-B Sample Rate\r
index 9a23e9969f922f319a2bbd234abbb811262a37fe..475d5210df3b80cd4d17abc67905853462a0b57d 100755 (executable)
@@ -40,7 +40,8 @@ struct TSPKCharData {
        double nPPC3_RTVA;\r
        double nPPC3_SysGain;\r
        double nPPC3_DevNonlinPer;\r
-       \r
+       double nPPC3_PIG;\r
+\r
        double nReHi;\r
        double nReLo;\r
        \r
index 640f41302d66f673d1dbefbf78621411e50b86a2..ea5344652e2403711d6b1dec325750f8214df065 100755 (executable)
@@ -39,6 +39,6 @@ void set_temp_cal(uint32_t prm_pow, uint32_t prm_tlimit);
 double get_re(double re_ppc3);\r
 double CalcRe(double re_ppc3, uint32_t prm_r0);\r
 uint32_t calc_prm_pow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain);\r
-uint32_t calc_prm_tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA);\r
+uint32_t calc_prm_tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA, double nPIG);\r
 void tas2557_ftc_stop(void);\r
 #endif /* TAS2557_LIB_FTC_H_ */\r
index 9a125a048913decbc96ac497391aea1918ffc9da..74e76c2d89c8af7d6fabb0ae5101e4a568d36e2d 100755 (executable)
@@ -89,6 +89,7 @@ uint32_t tas2557_ftc(double t_cal, struct TFTCConfiguration *pFTCC)
        dev_a_re = get_re(gpFTCC->nTSpkCharDevA.nPPC3_Re0);\r
        tas2557_switch_device(gpFTCC->nTSpkCharDevB.nDevAddr);\r
        dev_b_re = get_re(gpFTCC->nTSpkCharDevB.nPPC3_Re0);\r
+       printf("dev_a Re=%f, dev_b Re=%f\r\n", dev_a_re, dev_b_re);\r
 \r
        // STEP 5: check speaker bounds\r
        nResult = check_spk_bounds(gpFTCC, dev_a_re, dev_b_re);\r
@@ -107,7 +108,8 @@ uint32_t tas2557_ftc(double t_cal, struct TFTCConfiguration *pFTCC)
                        gpFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer, \r
                        gpFTCC->nTSpkCharDevA.nPPC3_RTV, \r
                        gpFTCC->nTSpkCharDevA.nPPC3_RTM, \r
-                       gpFTCC->nTSpkCharDevA.nPPC3_RTVA);\r
+                       gpFTCC->nTSpkCharDevA.nPPC3_RTVA,\r
+                       gpFTCC->nTSpkCharDevA.nPPC3_PIG);\r
                set_re(gpFTCC->nTSpkCharDevA.nPPC3_Re0, dev_a_re, gpFTCC->nTSpkCharDevA.nSpkReAlpha);\r
                set_temp_cal(dev_a_prm_pow, dev_a_prm_tlimit);\r
        }\r
@@ -125,7 +127,8 @@ uint32_t tas2557_ftc(double t_cal, struct TFTCConfiguration *pFTCC)
                        gpFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer, \r
                        gpFTCC->nTSpkCharDevB.nPPC3_RTV, \r
                        gpFTCC->nTSpkCharDevB.nPPC3_RTM, \r
-                       gpFTCC->nTSpkCharDevB.nPPC3_RTVA);\r
+                       gpFTCC->nTSpkCharDevB.nPPC3_RTVA,\r
+                       gpFTCC->nTSpkCharDevB.nPPC3_PIG);\r
                set_re(gpFTCC->nTSpkCharDevB.nPPC3_Re0, dev_b_re, gpFTCC->nTSpkCharDevB.nSpkReAlpha);\r
                set_temp_cal(dev_b_prm_pow, dev_b_prm_tlimit);\r
        }\r