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.

Multi channel use ADC in TMS320C5505

Other Parts Discussed in Thread: TMS320C5505

Hi

       I used ADC in TMS320C5505. here I select channel-1 and read it value. but i monitor channel-3 and channel-4 value. it  also change depends on channel-1 value. Hardware side no short connection. but value change. please help me. i post my code there.

#include<stdio.h>
#include "usbstk5515.h"
#define SARCTRL *(volatile ioport Uint16*)(0x7012)
#define SARDATA *(volatile ioport Uint16*)(0x7014)
#define SARCLKCTRL *(volatile ioport Uint16*)(0x7016)
#define SARPINCTRL *(volatile ioport Uint16*)(0x7018)
#define SARGPOCTRL *(volatile ioport Uint16*)(0x701A)
int i;
void main()
{
            USBSTK5515_init();
          //------------ADC Initialization----------------//

        SARCTRL = 0x1C00;
        SARCLKCTRL = 0x0031;
        SARPINCTRL = 0x7106;
        SARGPOCTRL = 0x0000;

        SARCTRL = 0x9C00;
        while(1)
        {
                 i=SARDATA;
                 printf("The ADC ch0 is %d\n",i);
                 SARCTRL = 0x9C00;
        }
}

 

  • Hello Ramanathan,

      Are you doing the battery measurement ?

      From your configuration , looks like you are using the external reference source, what is the reference voltage that you are providing ?

    You may have to write '0' to reserved field in PIN CNTL configuration  instead of '1'. 

    Is there any pull ups on the other GPAINs  ?

    Please let us know the info on the above.

    Regards

     Vasanth