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.

Interfacing the ADS8332 to the TMS320F28835

Other Parts Discussed in Thread: ADS8332, TMS320F28335, CONTROLSUITE, ADS8322

I am trying the included pdf and code of the "Interfacing of ads8332 to the TMS320F28335 found here in the website and i am having some problem running the code.loopcount watch variable say "error execution stop" Please anyone help me how to solve the problem.

  • Hi Mark,I am not sure that your files got attached.
    Are you able to successfully run other F28335 example projects form ControlSUITE?
  • Thanks Devin, i have found the solution but my problem now is it that it have an error after the line ADS833x_init() ; 

    Gpio_setup();
    InitSpiGpio();
    spi_init();
    ADS833x_Reset();
    ADS833x_init(); --> code stop after here

    I am sorry i am a beginner in electronics using the TI chips. I am attaching here hardware configuration of the interface between ADS8332 to TMS320f28335 in which i want to ask what is the following:

    1. VDDIO and VDD in the f28335 and the VBD and VA in the ADC module?

    2. Do i need to connect an analog input to the ADC module for the code i downloaded here in your website to work?

    Thanks for the answer.

  • On the ADS8322, it looks VA is the analog supply(5V) and VBD is the digital supply (3.3V). On F28335, the digital supply is VDDIO (3.3V) and the core supply is VDD (1.2V).
    You can definitely connect the two 3.3V supplies together, but make sure to check both datasheets for maximum current draw and compare with the current capabilities of the voltage regulator IC. You will need separate voltage sources for the other two rails (1.9V on F28335 and 5V on ADS8332).
    If you don't connect an analog input, it shouldn't cause any issues with code execution. Floating ADC inputs will generate garbage conversion results, but otherwise everything will function fine. Once the code is working you will probably want to connect the ADC input to some DC voltage so you can guage if the conversion results are roughly as expected.
  • Thanks for the good answer Devin. I already connected the pins and still having problem with the source code and stop after ADS833x_init();
    Note: the source code is downloaded from TI website :

    // TI File $Revision: /main/$
    // Checkin $Date: June 11, 2012 10:16:38 $
    // Author: Dale Li


    Gpio_setup();
    InitSpiGpio();
    spi_init();
    ADS833x_Reset();
    ADS833x_init(); --> code stop after here

    void ADS833x_init() // Initialize ADS833x
    {
    Reg_Word = ADS833x_Write_Com + ADS833x_CFR_Reg;
    ADS833x_WriteRegister(Reg_Word); // ADS833x internal CFR register configuration

    while(SpiaRegs.SPISTS.bit.INT_FLAG !=1){} // Wait until RX data is ready

    ADS833x_Buf[0] = ADS833x_ReadRegister();
    ADS833x_Buf[1] = ADS833x_Buf[0] & 0x0FFF;
    if(ADS833x_CFR_Reg != ADS833x_Buf[1]) error( ); // Check that CFR register content
    }
  • By debugging the code and step into this ADS833x_init function;

    void ADS833x_init() // Initialize ADS833x
    {
    Reg_Word = ADS833x_Write_Com + ADS833x_CFR_Reg;
    ADS833x_WriteRegister(Reg_Word); // ADS833x internal CFR register configuration

    while(SpiaRegs.SPISTS.bit.INT_FLAG !=1){} // Wait until RX data is ready

    ADS833x_Buf[0] = ADS833x_ReadRegister(); --> Buff[0]= 0xFFFF value
    ADS833x_Buf[1] = ADS833x_Buf[0] & 0x0FFF; --> Buff[1]= 0xFFF
    if(ADS833x_CFR_Reg != ADS833x_Buf[1]) error( ); // Check that CFR register content --> this part code stops

    so at the above {if }function; 0xFFF is not equal to 0xFBD so comes out an error,

    1. why does ADS833x_Read Register is always equal to 0xFFFF??

    Uint16 ADS833x_ReadRegister() // Read CFR register
    {
    Uint16 rData0;
    while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG !=0) { } // Wait until SPITXBUF is free
    SpiaRegs.SPITXBUF= 0xC000;

    while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG !=0){} // Wait until SPITXBUF is free
    rData0 = SpiaRegs.SPIRXBUF; // Read RXBUF to clear INT_FLAG
    while(SpiaRegs.SPISTS.bit.INT_FLAG !=1){} // Wait until RX data is ready

    rData0 = SpiaRegs.SPIRXBUF;
    return rData0;
    }
  • Hi Mark,

    At this point I would probably connect an oscilloscope or logic analyzer to the SPI pins that are connected to the external ADC and see what is flying back-and-forth on the bus.  My guess is that you aren't getting good data back from the external ADC, which could be an issue with that part, or something like not setting up the GPIO MUX correctly for SPI mode on the F28335.

     

  • I will attached after this the source code i downloaded here and the PDF from Dale Li about the interfacing
    Thank you for the response
  • while(SpiaRegs.SPISTS.bit.INT_FLAG !=1){} // Wait until RX data is ready //
    it seems this code is for reading the CFR of the ADS8332 but unlucky is that it cannot trigger the interrupt for reading the RXBUFF.

    what might be the problem? in the hardware connection or the code itself?
  • I am sorry, i fixed the problem by checking hardware connection. and code is working