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.

TAS2559: Configuration Programming for Baremetal Application

Part Number: TAS2559
Other Parts Discussed in Thread: , TAS2563

Hello, 

I am trying to determine exactly what must be programmed onto a TAS2559 chip in a baremetal environment in order to bring it up and how that programming is to be done. I am using PPC3 to characterize the speaker I will be using and I have gone through the End System Integration process to generate the required files, but I cannot identify how to use these files in the correct manner. 

The application in which the TAS2559 will operate consists of an STM32 baremetal MCU that will communicate with the TAS2559 over I2C and a speaker that has been characterized within PPC3. I need to run the TAS in "Smart Amp Mode" to support the large characteristic file; I assume that "Smart Amp Mode" and "RAM Mode" are the same thing: 

Generation in RAM Mode produces the following files: 

I don't know what I'm supposed to do with any of these files. Per the PPC3 & TAS2559 documentation, these .cfg files contain I2C programming instructions in the scripting language specified within the PPC3 User Manual, but how do I use them? I can copy-paste the contents of the .cfg files into the I2C comms box in PPC3, but outside of PPC3 they do not seem very useful. Do I have to transfer a specific file to the TAS in some way? Or are the .cfg files only relevant within PPC3? In that case, do I have to use the .bin or .json file somehow?

Furthermore, none of the .cfg files are themselves sufficient to enable audio output on the TAS2559EVM eval board. I've tried following the programming guides in the TAS2559 manual to append enable instructions to the .cfg files, but that has not worked. The only way I can get audio out of the eval board is to either perform the System Checks routine in PPC3 (which causes audio output during the "Checking audio playback and record for Device A..." stage) or by pressing the Tuning and Audio Processing button and letting PPC3 run its own .cfg files. I have tried to use the I2C log to compare the instructions in my generated .cfg files with the instructions sent by PPC3 during either of these automated processes, but there are too many references to register pages and books that have no documentation for me to identify what's going on. 

To summarize, I am looking to simply program the generated files for my characterized speaker onto the TAS2559 in a baremetal, non-Android/Linux environment that cannot take advantage of the Android drivers that have been posted on other forum pages. Help is greatly appreciated - thank you in advance! 

  • Hi Sam,

    I'll take a look at your questions and provide further inputs by tomorrow before the end of the day. Sorry for the delayed reply.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Sam,

    For more recent devices, like TAS2563, the End System Integration panel generates a header file you can use with C codes to load the register values. How did you selected TAS2559 for your application?

    Would header file be good for your application? If it does, I'll check if we have any non-released PPC3 version that can generate header files for TAS2559, or alternatively a script you can run in C or Python to translate cfg into .h

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Ivan,

    A header file with the generated I2C writes would be great. I noticed in the PPC documentation appendix B that such a header could be generated, but I couldn't figure out how - either a PPC3 version that has that functionality for the 2559 or a script would be awesome. I'm not exactly sure how the 2559 in particular was selected, but I can investigate that further if it is relevant.

    Thanks!

  • Hi Sam,

    I'm working on this with our PPC3 development team, I'll give you further updates early next week.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Sam,

    Attached is a simple script to generate a header file from cfg you can use. The file named "combined_configuration_0_TuningMode_48KHz.cfg" has all required register settings.

    In order to use the parser please follow this instructions:

    • Copy the cfg file you want to convert to header file
    • Paste it in the same folder as the parser
    • Rename the file as "parse.cfg"
    • Run the "main" script; you need python for this
    • A new file called "parsed.h" should be generated based on your original cfg file

    Or you can always send me the output files you get from PPC3 and I can send back the header file.

    Best regards,
    -Ivan Salazar
    Applications Engineer

    headerParser.zip

  • Excellent, I am able to use these scripts to generate the header files. Thank you! 

    While I await the construction of our product hardware, I'd like to verify that this configuration properly initializes the TAS chip using the TAS2559EVM eval board and PPC3. How can I utilize the combined_configuration....cfg file within PPC3? I have tried copy-pasting the contents of the config file into the Direct I2C module in PPC3 and adding the analog block power-up writes as specified in the TAS datasheet, but I can't get audio out using this combination of I2C transactions. Am I missing an initialization step somewhere, or is there another way to use these .cfg files in PPC3? 

  • Sam,

    You should be able to just use the combined configuration cfg for initialization. Are you using I2S signal from USB? Perhaps you can read back Interrupt Flags to check if there is any protection being triggered. I'll share some guidelines on how to read back registers, along with an example of how to use cfg. I'll come back with this by end of the day tomorrow.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Ivan, 

    Sorry for the delay. I am using the Direct I2C tool to write the config:

    After writing the configuration and attempting to power up the analog blocks, I can read back registers 68 and 6C in page 1 book 1; 68 reads 0s and 6C reads 02, which is a reserved bit in the interrupt 2 register. What do I do with this information? 

  • Hi Sam,

    I'll need to dig into device details to check the bit you mentioned.
    In the meantime, can you please share the exact same set of commands you're using? You can save it as text in a cfg file, if not already in that format.
    I'd like to test it on my side, and check if there is anything outstanding that could be related.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • 3005.combined_configuration_0_TuningMode_48KHz.cfg

    Ivan, 

    Attached is the cfg file I am using. Below is the set of audio block enable instructions I have copied from the chip documentation:

    w 98 05 A3 # Power up Analog Blocks
    w 98 04 B8 # Power up DSP and clock dividers
    w 98 07 00 # Unmute Analog Blocks
    w 98 7f 64 # switch to book100
    w 98 07 00 # Soft stepped unmute of audio playback

    Thanks, 

    Sam

  • Hi Sam,

    Thanks, I'll give it a try tomorrow and provide some comments after that.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Sam,

    I tired your script and didn't work on my side, however it may just be an incorrect clock setting. Could you please confirm your selections for Sampling Frequency, Clock Source and Clock Frequency? I tried the default script I've got from PPC3 and it works.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Ivan, 

    For this configuration, the sampling frequency is 48kHz, the clock source is MCLK, and the clock frequency is 3.072MHz. The latter two values were chosen somewhat arbitrarily, though I have tried a few other clock configurations as well. I'm not sure how to select these clock values while working with the TAS2559EVM eval board - I see that J17 and J18 reference the bit and master clock respectively, but how do I select the frequencies at which those clocks run? 

    Thanks,

    Sam

  • Sam,

    On the EVM, these signals come from TAS1020B, it should be:

    • MCLK = 12.288MHz
    • BCLK = 3.072MHz
    • WCLK = 48kHz

    However if you use external signals you can use any of the available options, I'll try your cfg using MCLK = 3.072MHz. You can also try the default settings I listed above and should work on your side as well. I thought you were using a custom system and not the EVM.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • I used MCLK = 12.288MHz and used the generated script and I finally got sound out of the chip. That clock frequency was the missing piece of information. 

    I am using the EVM to explore the chip bringup procedure while we wait for a hardware shipment. The python script you provided should get me the rest of the way there. Thank you very much for your help!