Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Two CS42448 chips interfacing with I2S and I2S1

  1. #1

    Two CS42448 chips interfacing with I2S and I2S1

    I want to separately interface two separate CS42448 chips to one Teensy 4.1. But before I try this I want to ask if an assumption I am making is valid.

    Assuming nothing else is connected to the Teensy 4.1 my assumption is I can use I2S (Teensy pins 21, 23, 7, 8, 20) for the first CS42448, and that I can use I2S1 (Teensy pins 4, 33, 2, 5, 3) for the second CS42448. The audio library objects I would be using for this are tdm1/tdm2 for the first CS42448 and tdm2_1/tdm2_2 for the second CS42448.

    Two questions:
    1. Are my above assumptions correct?
    2. Is there an example that someone can point me to that uses some of the functions in the Audio Library control_cs42448.cpp/control_cs42448.h routines?

    I know there are other efforts to use a single TDM with two CS42448s, but I would like to know if my brute force interfacing plan makes sense.

    Thanks in advance for the sanity check.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,058
    It should work to connect them to different I2S.

    When you open the .h file, you will also see the available functions:
    https://github.com/PaulStoffregen/Au..._cs42448.h#L36
    Code:
    class AudioControlCS42448 : public AudioControl
    {
    public:
        AudioControlCS42448(void) : i2c_addr(0x48), muted(true) { }
        void setAddress(uint8_t addr) {
            i2c_addr = 0x48 | (addr & 3);
        }
        bool enable(void);
        bool disable(void) {
            return false;
        }
        bool volume(float level) {
            return volumeInteger(volumebyte(level));
        }
        bool inputLevel(float level) {
            return inputLevelInteger(inputlevelbyte(level));
        }
        bool inputSelect(int n) {
            return (n == 0) ? true : false;
        }
        bool volume(int channel, float level) {
            if (channel < 1 || channel > 8) return false;
            return volumeInteger(channel, volumebyte(level)); 
        }
        bool inputLevel(int channel, float level) {
            if (channel < 1 || channel > 6) return false;
            return inputLevelInteger(channel, inputlevelbyte(level));
        }
    private:
    [...]
    I had almost overseen that it allows to set the I2C address.

  3. #3
    Yes I saw the function that allows multiple I2C addresses. I was hoping to also find an example sketch that uses some of the control_cs42448 functionality and possibly and example that interfaces with the input_tdm and output_tdm audio library elements.

    Thanks for your confirmation that you think it should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •