AnsweredAssumed Answered

ADUCM360 Can't sample more than 128 times

Question asked by Absel on Nov 15, 2017
Latest reply on Nov 21, 2017 by Absel

Hello. I'm using an RTD_Demo.c based software and I'm trying to implement a counter consisting of 256 samples. The issue I'm having is that the UART is not receiving anything when I go above 128 samples. The code I'm using is as follows:

 

int main (void)
{
   pADI_WDT ->T3CON = 0;                                        //DISABLE watchdog timer
   DioOen(pADI_GP1,0x8);     
     DioWr(pADI_GP1,0x8); //Inicializamos P1.3 con un '1'    
     //DioOen(pADI_GP1,0x4);    // Set P1.2 as an output for test purposes
   WdtCfg(T3CON_PRE_DIV1,T3CON_IRQ_EN,T3CON_PD_DIS); // Disable Watchdog timer resets   
     CLKSET();           
   ADC1INIT();                            // Setup ADC1   
     UARTINIT();
     fVoltage = 2.25;
                       

 

   while (1)
   {
         fVoltageUART = 0; //reset previous value
         sum_pulsos = 0;
    
        while(bSendResultToUART == 0){} //WAIT FOR SAMPLES TO ACCUMULATE
      //DioTgl(pADI_GP1,0x8);  //toggle P1.3
        if(fVoltage < 1)  //meaning buffer ON
       {
         //delay(200);*
         DioWr(pADI_GP1,0x8); //put the buffer OFF (Z)
       } else if(fVoltage > Vthresh)// (buffer OFF but < threshold)
       {
         //delay(200);*
         DioClr(pADI_GP1,0x8); //put the buffer ON
       }    
        
        
          for (ucCounter = 0; ucCounter < SAMPLENO; ucCounter++) //Bucle sumatorio de samples
      {
                 fVoltageUART += (((float)ulADC1DATRtd[ucCounter]*3.287)  / 268435456);
                 if(fVoltage > Vthresh)
                 {        
                  sum_pulsos = sum_pulsos + 1;
                 } else {
                //Buff ON *                
                 }
      }
        
            fVoltageUART = fVoltageUART/SAMPLENO;    // Average our 8x samples            
            bSendResultToUART = 0;        
            SendResultToUART();                       // Send results to UART
            
        }    
}

 

With 128 or below I get to receive everything in Hyperterminal, above that number I can't figure out how to do it.

Any ideas?

Outcomes