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.

TMS320F28377D how to configure 16-Bit AD-conversion?

Other Parts Discussed in Thread: TMS320F28377D, CONTROLSUITE

I am on designing a new motorcontroller with the TMS320F28377D MCU. According to the datasheet

16- bit conversion is only possible with differential mode. I have to use per example ADCINA0 and ADCINA1 and generate a differential signal per example with a THS4521D fully differential amplifier.

How must I setup the SOC events. Do I have to configure 2 different SOC events for one conversion?

AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0;         
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 7;        
AdcaRegs.ADCS1C0CTL.bit.CHSEL = 9;        
AdcaRegs.ADCS1C0CTL.bit.TRIGSEL = 7;         

Please give me a detailed code example? I dont find it neither in the manual nore in the controlsuite




   

  • Hi Dr. Stiebel,

    Actually you only need one SOC to do a differential conversion.  If you have used Piccolo series MCU in the past or have F2837xD device working with single-ended conversions, then really the only difference is to set the ADC of interest into differential mode. 

    AdcaRegs.ADCCTL2.bit.SIGNALMODE = SIGNAL_DIFFERENTIAL; //0 = single-ended, 1 = differential

    When you set the ADC in this mode, it will automatically convert an odd/even channel pair when the SOC trigger is received.  e.g. if you select CHSEL = 2 for SOC0, then the differential signal on channel 2 (+) and channel 3 (-) will be converted and the result placed in result register 0.  If you set CHSEL = 4 for SOC1, the the differential signal formed by channel 4 (+) and channel 5 (-) will be converted and the result placed in result register 1.  

    With respect to the table you have copied: 

    Looking at this table, I realize it is both incorrect and confusing.  The "and" in the table should be "or": you can select either option and get the same differential pair conversion - you don't have to select both or configure two separate SOCs.  Also, channel pair 0/1 is selected by writing either 0 or 1 to CHSEL (not 0 or 8), channel pair 2/3 is selected by writing 2 or 3 to CHSEL (not 1 or 9), etc.

    I will get this fixed in the next TRM revision.  In the meantime, please refer to the bit-field definition for the channel select (see below) which is both clear and correct.

  • Dr. Stiebel,

    One more point on using 16-bit mode.  Early TMX samples do not have programmed OTP.  Because of this:

    1) ADC will not have trims, so performance will not meet datasheet specifications

    2) The following sequence may be necessary to unlock 16-bit mode (if not used, ADC may be stuck in 12-bit mode, which will be apparent when looking at conversion results):

    *Connect to the device
    *Perform a debugger reset in CCS
    *Set a hardware breakpoint at the reset vector in the dissasembly (current location of the PC)
    *Load the symbols for the test program to CPU1
    *Manually reset the device via XRSn
    *View DevCfgRegs.PERCNF1.all in expressions window (may require refresh if already in window)
    *Write 0x0000 to above register
    *Hit run twice in CCS, should end at "ESTOP0"
    *Load test code
    *Run test code
    *Further code can be loaded and run without issue until power cyle/XRSn reset

     

  • Hi,

    I tried these instructions, but it still does not work.

     

  • Hi Laura,

    You can directly verify whether this worked or not by looking at the DevCfgRegs.PERCNF1.all register after you load your program.  If it is all 0's, then you should be able to set the ADC in 16-bit mode.  If it is anything else, you probably won't be able to.  

    One important point for the above sequence is that for this line:

    *Manually reset the device via XRSn

    You can not use CCS; you have to actually make the pin go low and then high.  If you have the ControlCard and docking station, this can be accomplished by connecting and then disconnecting pin 120 from ground.  

  • I did that. Does that mean that my chip does not have the 16-bit mode?

    The following two lines are printed on the chip:    XF28377DZWT

                                                                                  YFA-3BATZYW

  • Laura,

    Your chip definitely has 16-bit mode.  Let me elaborate a little bit on the procedure:

    Connect and do JTAG reset:

    Load symbols

      

    View this in expression window:

    Hit run button two times

    Please try this and let me know if this works.  If it doesn't work, let me know specifically where it goes wrong.

  • This is very confusing with the CCS environment. Please provide procedure on how this can be done with standalone code (i.e. DSP not connected to emulator). thanks.

  • Theo,

    You have to use an emulator to accomplish this; it is not possible to write standalone code.  

     

  • Hi Devin,

    I was afraid you would say that. Any idea when the next silicon revision will be available for samples? thanks.

  • Theo,

    I am not sure when new samples will be available; at least not for a couple months.  

  • It works! Thank you!

  • Hi Devin, Does MCU need to unlock 16-bit mode ADC every time it powers up?  Is there a way to hold this mode? Thanks.

  • Hi,

    I have tried the procedure several times but it still doesn't work. After hitting twice the run button, the value for DevCfgRegs.PERCNF1.all passes from 0x0000 to 196623. Can you help me on this point ?

  • Hi, Devin

    It seems to see same things on ADC Errata : Analog Trim of Some TMX Devices.
    Is this operation required except workaround of Errata ??

    Regards
    Hiroyasu

  • Hi,

    what's the error if I run it twice in CCS and it doesn't end at "ESTOP0"? DevCfgRegs.PERCNF1.all is 0, but it doesn't run...
  • Hi Laura,
    After CCS hangs, if you halt the code execution where is the PC? If you load code and run at this point is PERCNF still 0 and the 16-bit mode active or not? Did you get new ControlCards that are exhibiting this issue, or is this still the same card that was working before?
  • Hi Devin,

    As you can see in the screenshot below, there is nothing to see in the disassembly-window after "Reset CPU, Breakpoint, Load Symbols, Reset XRSn, 0x0000, 2 x Play". Then I load and run the code. PERCNF is still 0.

    This time I use the DSP on another board , not on the ControlCard. But it's the same DSP like before...

  • Hi Laura,
    I am honestly not sure why you aren't seeing anything in the disassembly view. Ignoring the workaround for 16-bit ADC operation, are you able to normally load and run code on this board/device? If so, are you sure you still need to use this workaround? Newer devices should not need this procedure.
  • Hi Devin,

    yes, I'm able to normally load and run code. I can't find more information in the internet in terms of my chip. Maybe you can tell me if I have a new chip:

    TMX320F28377DPTPT

    YFB - 51C3J5W

    G4

  • Hi Laura,

    This is a revision B device, tested in Feb of 2105, so I think this should not require the workaround.

    The easiest way to see would be to connect to the device, load code (or symbols), and then check the PERCNF registers. If they are 0, then the device does not require the workaround.
  • Hi,

    I found the mistake. I had two boards. One of them was an older revision and had a " YFA " on the chip. Now I was able to adjust the 16 bit mode in the normal way because of the "YFB" printed on the chip. Thank you!

    Laura