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.

TLA2518: SPI example

Part Number: TLA2518

Where are the code examples this part? 

I read another post a similar question, and TI's response was there are none. 

I have to say that's ridiculous!!!  Obviously you had to write code to test it, so share it. 

The data sheet is not very clear on many things, so a simple example would be very beneficial to compensate for the lack in the data sheet. 

  • Hi James,

    We do not have full example code available but we do have a header file available that should help provide a starting point. Additionally, if you have any question on the device or the device operation, feel free to ask. 

    sbac286.zip

    Regards,
    Aaron Estrada

  • Not really looking for "full example code"  Just a small snippet on say reading AN0. 

    The data sheet explains "Register Rread Operation" but there is no register for Analogs. 

  • Hi James,

    The TLA2518 launches the 12-bit conversion result directly on the SPI interface. The host does not need to read register for ADC conversion result. This is explained in the output data format section of the datasheet (link to relevant section in the datasheet).

    When reading registers, the host provides an opcode corresponding to register read on SDI. This is how the ADC knows to launch register data and not ADC data in the next frame. However, if opcode on SDI is NOP, the output data will be the conversion result.

    I hope this clarifies the data interface with the TLA2518. Please let us know if you have any follow-up questions.

    Regards,

    Rahul

  • Thank you. I have it working now. 

    So, a few recommendations for the data sheet. 

    #1) Section  " 7.3.9.2   Register Read/Write Operation " could use an update. The command description for OPCODE 0x00 says " No Operation ". IMHO, anyone reading that would think it does nothing. When in fact it does. To add to the confusion, no where in the pdf do you see that OPCODE referenced. Thus making someone think its useless. 

    #2) There are " 7.3.9.2.1   Register Write " & " 7.3.9.2.2   Register Read " sections. There should also be an added section for reading the ADC channel. I cannot possibly see how anyone could figure out what you suggested to do on their own with this data sheet and no examples because no where does it say how to read the ADC channel by sending a NOP first. 

    I am curious on averaging. This is a 12-bit ADC. When you turn on averaging the output becomes 16-bit. This does not make much sense to me. If your averaging 12 bits x times, then the output at the end should be 12-bit. How does it become 16-bit? 

    I want to use averaging, but the 16-bit output messes things up. How can one use averaging while keeping it 12-bit? Should I just shift right by 4 to remove the 4 LSB's ?   

  • Hi James,

    Oversampling by a factor of 4 improves resolution by 1 bit when uncorrelated or white noise is dominant. Please refer to this app note for more details on improving resolution with oversampling: Resolution Boosting ADS7138 Using Programmable Averaging Filter. Hence, the output format is 16-bit when the averaging module is enabled.

    In case you want to get 12-bit result with oversampling enabled, there are two options:

    1. Right shift the 16-bit output from the ADC by 4
    2. Read only 12-bits with a 12-clock SPI frame. As the data is MSB aligned, the host will read the 12 most-significant-bits.

    Regards,

    Rahul

  • Hi James,

    Thanks for the recommendations on clarifying the topics related to reading data in the datasheet. We will certainly revisit these sections when the datasheet is updated.

    Regards,

    Rahul