Post Go back to editing

working tutorial, eval adau 1467 and teensy4.1 to control it, in C

Category: Hardware

Hello, as i was not able to get a working solution with my esp32 in spi to control my eval adau 1467, this time i will try with another board i have and whose sister (teensy 4.0) was the chosen one by ADI for its tuto. We will try spi and i2c. The goal is to help the community to get started with all the needed details of the actions i will go thru to get the mcu control this eval board.



Typos fix
[edited by: iravelo at 6:38 PM (GMT -4) on 31 Oct 2022]
  • This is the little beast we’ll be using...programmed in C under linux vscode+ platformio extension

  • Let’s start by noting all the needed signals for i2c : scl, sda, gnd; and also one gpio for reset, in total, 4 pins to use. 

    • Gnd will be the one in the upper left corner of the board,

    The i2c i choose is the one without suffix , so,

    • SCL is pin 19
    • SDA pin 18
    • Reset will be gpio OUT1C on pin 9
  • And here is the usual suspect : the infamous 10pin, J1 / "CONTROL PORT" port,

      where we’ll use pins 1, 3, 6, and 10

  • As dave thib suggested, the 1st step will be to check if, once all the needed wired are connected, we can get to read 1 innocent dsp register whose value is totally predictable after cold boot or reset.

  • If anyone sees anything wrong in the wires and connections, please object loud and clear.

  • The twisted white and green wires are out of today’s equation, they are used by another project involving the little red daughterboard and one of its dual canbuses.

  • Hello iravelo,

    If you are using I2C then please note this.

    The ADDR0 and ADDR1 are those pins who choose the device address. It has different combinations. Look at the below table from the datasheet.

    In our ADAU1467 Eval board , the ADDR0 is tied to IOVDD. which represents a binary one (HIGH) always. So by connecting ADDR1 to GND ( '0' - LOW)  OR connecting ADDR1 to 3.3v ( '1' - HIGH), You can get the addresses 0x72 (ADDR1 - LOW) and 0x76 (ADDR1 - HIGH) respectively.

    In the example code given in that wiki page assumes that both ADDR0 and ADDR1 pins are set to LOW. That's not gonna be true for our Eval board since ADDR0 is tied to IOVDD. So you have to change the binary value in the below code, based on any of these addresses (0x72 or 0x76) that is given in hex.

    Also keep in mind that the wire library of teensy uses 7-bit addressing. It omits the Read/Write bit. That's why 7 bits were given for addressing in the below code.

    In hardware set up, simply change this - Pin-8 of the slave control port (J1) is ADDR1. Connect it to either ground (0x72)  or 3.3v (0x76). In 7-bit addressing it is 0x39 and 0x3B respectively.

    The other way around is Pin-9 of the slave control port (J1) is ADDR0 .which is already tied to IOVDD. You can leave that as it is for now. You don't really need to touch it now.

    If you want to change the state then remove that R68 resistor. Refer the schematics for more info.

    So in your set up you have to connect pin 8 to either ground or 3.3v.

    Regards,

    Harish

     

  • hi Harish, nice you took a few minutes to take care of my project.

    I did not pay special attention to I2C addr of ADAU1467 changing according to states of ADDR0 & ADDR1 (meaning SS and MOSI lines in fact), thanks for mentionning that, I appreciate.

    What I was about to code was :

    const int DSP_I2C_ADDR = 0b0111000; // From ADAU1463 datasheet Table 26; assumes ADDR1 and ADDR0
    // low (eval board); adjust for your application.
    as found in ADI provided file.
    So, I understand that if I leave pin 9 / ADDR0 / SS alone (==not connected, not used), its state is HIGH as it is internally tied to IOVDD;
    But i need to decide what to do with pin 8 / MOSI / ADDR1; I'll go the LOW / GND way for him ! so my ADAU's I2C will be at address 0x72, or 0x39 in 7 bits