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.

TMS320F2808: ADCPWDN Register

Part Number: TMS320F2808

Hello,

When I'm initialising ADC to measure voltage amplitude, not getting a proper ADC digital value and i'm thinking may be missing of [ADCPWDN] bit & DELAY() on the initialise code. Here's some assumption, may be to correct the Digital value.

# ADCPWDN (ADC power down) register is most really required to initialise ADC peripheral technology?

# If i don't used the ADCPWDN register, can be ADC peripheral technology works?

# Is it work, if i used all necessary ADC register to measure external signals except this ADCPWDN register bit?

  • The ADC needs to be powered up in order for it to work properly.  I would recommend that you follow the power-up sequence from Section 1.6 of the F280x ADC Reference Guide.

  • Hello Lee,

    1# Is it work, for measuring voltage through ADC input pin or something missing on the code?

    Here's my ADC initialisation code for voltage measuring:
    void init_epwm(void)
    {
    	AdcRegs.ADCTRL1.bit.CPS = 0;			        // 6.25MHz; ADCCLK=FCLK/1;
    	AdcRegs.ADCTRL3.bit.ADCCLKPS = 2;	 	// HSPCLK=25MHz; ADC clock: FCLK=HSPCLK/2*ADCCLKPS = 6.25MHzz
    	AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; 		// 1=CASCADED Sequencer
    	AdcRegs.ADCTRL3.bit.SMODE_SEL = 0;		// SEQUENTIAL sampling mode
    	AdcRegs.ADCTRL1.bit.ACQ_PS = 3; 		        // S/H =(ACQ_PS+1) x tADCCLK=640ns
    	AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 1; 	// ADCINA0 as input
    
    	AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1;		// Software trigger for SEQ1
    
    	AdcRegs.ADCMAXCONV.all = 0;   			        // 1 Conversion
    	AdcRegs.ADCASEQSR.all = 0;			        // 1 (SEQ)Sequencer Conversion
    
    	AdcRegs.ADCTRL1.bit.CONT_RUN = 1;		// Continuous run mode
    	AdcRegs.ADCTRL1.bit.SEQ_OVRD = 0;		// Disable Sequence Override
    	AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1;	// 1=enable SEQ1 interrupt
    	AdcRegs.ADCTRL2.bit.INT_MOD_SEQ1 = 0;	// 0= interrupt after every EOS (end of sequence)
    }
    
    __interrupt void adc_isr(void)
    {
    
    	Va0 = AdcMirror.ADCRESULT0;			        // store results globally
    
    	
     	AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;       	        // Reset SEQ1 (bit useful in Start/Stop operation)
     	AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;		// Clear INT SEQ1 bit
      	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; 	// Acknowledge interrupt to PIE (common to all)
    }
    

    2# Feeding voltage to ADC across Input pin[ADCINA0] to GND through Buffer circuit & RC filter circuit. The value of R is within 50ohm & C is 204PF [C=4096*4*(10PF+1.64PF)=~204PF]. Here's the external circuit used to feed voltage across 'Input pin' to 'GND':

  • Asim,

    I do not see the recommended ADC power-up sequence.  Please confirm that it is in your code.

    You can also see the adc examples in the software support package for reference.

    -Tommy

  • Hello Lee,

    Now I'm using ADC power-up sequence in a code and previously i have missed to used it.

    Actually, when Debugging the ADC for measuring voltage, a fixed Digital value has been displayed at 'Watch Expression Window' that is 2989, even if varying the ADC Input Voltage of 0V to 3V.

    Here's the attachment of the code, that i'm Debugging.

    e2e.ti.com/.../0181.ADCvoltageMeasuring.c

  • Asim,

    Can you confirm that the ADC sequence is being continually triggered as expected? I only see one ADC SEQ trigger, and it is asserted before the ADC is configured for continuous mode.

    My guess is that the example code is only triggering a single ADC conversion per execution.

    -Tommy

  • Hello Lee,

    # Are you seen my above recommended code "ADCvoltageMeasuring.c" & Is it work to measure Voltage ?

    ---------------------------------------------------------------------------------------------------------------

    Can you confirm that the ADC sequence is being continually triggered as expected?

    ---------------------------------------------------------------------------------------------------------------

    How'll know the ADC sequence is being triggered continually (or properly)?

    In my code i have used  'Software trigger' for Start-of-Conversion of a ADC sequence.

    # Is it required to change execution sequence, that is configured Continuous mode register before ADC SEQ trigger mode.

    # Yes, the above code is triggering a single ADC conversion per execution.

  • Asim,

    Yes, I looked at your attached file.

    You can include a counter in your ADC ISR to observe how many times the ADC is triggered and serviced.

    Again, I do not see any ADC triggers after you have configured it for continuous mode.

    -Tommy