This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What are the differences between TMS320C5515 and TMX230C5515?

Other Parts Discussed in Thread: TMDX5515EZDSP

The second question is why I cannot set channels 0 through 2 on GPIO0 for converting by SAR ADC input voltage? The value is always about zero. All the other channels work flawless. Could someone please provide me with a proper registers configuration which will help me to avoid the issue.

  • Could you please provide details? 

    Do you have both TMS and TMX devices and one is working and the other is not? 

    Are you referring to GPIO or SAR?

  • I'am referring to SAP and its GPAIN0. I only have TMX device.

    Here is the details:

    1. After connecting my TMDX5515EZDSP device and loading the code on it, set up to convert input voltage from GPAIN0 by SAR ADC, the values I get after ADC are look like the noise (i.e. the values are less then 10) despite of the input voltage values are much higher.

    2. When I connect my signal generator output(which generates sin waves f=100Hz and A=0.1-0.7V ) to the inputs GPAIN1, GPAIN2 and GPAIN3 with the same registers configuration as it was for GPAIN0(it is a default configuration) and set up CH3, CH4, CH5 respectively, the SAR ADC works perfectly. Note that the registers configuration is default after the reset(right after connecting of the board to USB).

    3. The example shown in the SPRUFP1(p.10, 2.4) also works great.

    4. But If I'am using the same SAR channel configuration as in SPRUFP1(p.10, 2.4) and changing only the channel number to be CH2(GPAIN numer remains the same - GPAIN0) instead of CH1, it fails and the results like in point 1. I.e. if the registers configuration in point 3 looks like:

    SARCTRL = 0x1000;

    SARCLKCTRL = 0x00D7;

    SARPINCTRL = 0x03602;

    SARGPOCTRL = 0x0000;

    and I only chnage the SARCTRL value to be equal to 0x2000, which means that the conversion will be started on the CH2. After that the values on this channel are like in point 1.

    5. Also when GPAIN0 CH0 is not grounded with all the rest values of registers being the same, SAR works like in point 1 i.e. it fails.

    6. To sum the above up, one could say that there is something wrong with GPAIN0, i.e. with the default configuration and either CH0 is grounded or not, it does not perform conversion(ADC SAR does not work) on either of the CH0, CH1, CH2, except the case when it's configured to mesure the battery voltage on CH1.

    If it possible could you or someone please provide me with a proper registers configuration that works flawless on TMDX5515EZDSP for GPAIN0 CH2 or CH0 or another workaround.

    Also I'd like to know if it possible to reproduce the above issue on the same device as mine and if it does, let me know the results. Any information on the issue will be appreciated.

  • I spent 2 or 3 hours and I believe there is a problem with documentation.

    GPAIN0 worked for me with:

     

      SARPINCTRL = 0x3F0A

    and reading it from channel1

      SARCTRL= 0x0400 (single reading), then

      SARCTRL= 0x9400.

     

    to read the ezdsp5515 2 switches

      SARCTRL= 0x0400 (single reading), then:

      SARCTRL= 0xB400.


    The bits I set did not make any sense according to the documentation. I was reading the forum to try to understand why it did work with my settings.

    Good luck,

    MV

     

     


     

  • ups... here is the correct settings I used for using GPAIN0 to read an external analog signal (using channel 1) :

     

    void initADC (void)
    {
        ADC_SARCLKCTRL        = 0x0100;
        ADC_SARGPOCTRL        = 0x0000;
        ADC_SARPINCTRL        = 0x370a;
        ADC_SARCTRL            = 0x0400;
        ADC_SARCTRL            = 0x9400;
     }

    int    getADC ( void ) // return >=0 if value is available
    {
        Uint16 res = ADC_SARDATA;
        if (res & 0x8000) return -1;
       
        return res & 0x03ff;
    }

    void restartADC (void)
    {
        ADC_SARCTRL            |= 0x8000;
    }

     

     

  • I have verified that the following configuration works for the channel 2:

    [Config]

        *SARCTRL = 0x2C00;                          // select AIN2, which is GPAIN0
        *SARCLKCTRL = 0x0031;                  // 100/50 = 2MHz 
        *SARPINCTRL = 0x7106;                   // GND SW On = 1
        *SARGPOCTRL = 0;

     

    [read data]

     *SARCTRL = 0xAC00;  // channel 2    
        while(1)
        {
            for(i=0;i<500; i++)
                asm(" nop");    
            val = *SARDATA;
            if((val&0x8000) == 0)
                break;
        }

    Thanks,

    Peter Chung

     

     

  • Why does bit 2 need to be set in the in SARPINCTRL register in the above example?  

    I have confirmed that the conversion fails if bit 2 is not set despite the fact that bit 2 is "reserved" according to table 11-6 in the technical reference manual. Is this behavior documented somewhere?

    Thanks.

  • This is to disable the high voltage protection circuits which prevent conversion when the analog voltage (AVdd) is lower than the voltage at the GPAIN0 pin; and the maximum allowed voltage at the GPAIN0 pin is 3.6V. Can you check the voltages you have?

    Regards.

  • I'm targeting the ezdsp5535 so AVdd is 1.3 V coming from ANA_LDOO. 

    I have a voltage divider of 2 10K ohm resisters between VCC_1V8  (test point 2) and ground which is providing about 900 mV to GPAIN0.  I confirmed this with a voltmeter.

    With SARPINCTRL bit 2 set I read about 680 which translates to (1.3 V * 680/1023) = .864 V.

    With SARPINCTRL bit 2 cleared I read 0 V.