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.

TMS320F280025: ADC software configuration difference compared with F28034

Part Number: TMS320F280025
Other Parts Discussed in Thread: C2000WARE

Hi expert, 

I am helping customer porting from F28034 to F280025. 

For ADC initiation, it looks big difference.

here is the F28034 code

 	EALLOW;
	AdcRegs.ADCCTL1.bit.RESET	= 1;   //did not find, does F280025 also have this bit, and also need to do it ?

	asm(" NOP ");
	asm(" NOP ");    

	AdcRegs.ADCCTL1.bit.ADCREFSEL	= 0;   // ADC reference, have changed successfully
	AdcRegs.ADCCTL1.bit.ADCBGPWD	= 1;   // did not find, does F280025 also have this bit, and also need to do it ?
	AdcRegs.ADCCTL1.bit.ADCREFPWD	= 1;   // did not find, does F280025 also have this bit,does internal reference enable by another module or enable always?
	AdcRegs.ADCCTL1.bit.ADCPWDN 	= 1;   // power up ADC, have changed successfully
	AdcRegs.ADCCTL1.bit.ADCENABLE	= 1;   // did not find, does F280025 also have this bit, and also need to do it ?

	DELAY_US(ADC_usDELAY);

	AdcRegs.ADCCTL1.bit.INTPULSEPOS	= 0;
	AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1; // did not find, does F280025 also have this bit, and also need to do it ?

I did not find many registers, could you kindly help to answer my questions in comment?

According to the F280025 TRM describes:

Power-Up Sequence

Upon device power-up or system level reset, the ADC will be powered down and disabled. When

powering up the ADC, use the following sequence:

1. Set the bit to enable the desired ADC clock in the PCLKCR13 register.

2. Set the desired ADC clock divider in the PRESCALE field of ADCCTL2.

3. Power up the ADC by setting the ADCPWDNZ bit in ADCCTL1.

4. Allow a delay before sampling. See the data manual for the necessary time.

I got the responding code as below:

EALLOW;

	AnalogSubsysRegs.ANAREFCTL.bit.ANAREFASEL=0;
	AnalogSubsysRegs.ANAREFCTL.bit.ANAREFCSEL=0;
	AnalogSubsysRegs.ANAREFCTL.bit.ANAREFA2P5SEL =0
	AnalogSubsysRegs.ANAREFCTL.bit.ANAREFC2P5SEL=0;
    //
    // Set ADCCLK divider to /4
    //
    AdcaRegs.ADCCTL2.bit.PRESCALE = 6;

    //
    // Set pulse positions to early
    //
    AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 0;

    //
    // Power up the ADC and then delay for 1 ms
    //
    AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1;
    EDIS;

    DELAY_US(1000);

Could you kindly help to review whether I leave some configuration or not?

BR

Emma

  • Emma,

    Someone should answer your questions soon.  In the mean time you can review this guide for some migration advice:

    TMS320F2802x/TMS320F2803x to TMS320F28002x Migration Overview

    Also the ADC examples in C2000Ware are a good place to review a standard ADC configuration.

    Best regards,

    Jason

  • Hi Emma,

    As Jason mentioned, probably the best method is to start from the ADC examples in C2000 ware.

    The powerup sequence you have is correct, but there are two points to consider:

    • If you want to power down/up the ADC wrapper, you can also set or clear the bit for the corresponding ADC in PCLKCR13.  Note that if the ADC bit in PCLKCR13 is cleared, writes to the ADC registers will have no effect, so this must be the first configuration written in the power-up sequence and the last configuration written in the power-down sequence.
    • The configuration of  AnalogSubsysRegs could affect multiple ADCs if multiple ADCs share VREFHI/VREFLO pins based on the pin-out of your device.