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

Thread: can I use pins A4+A5 for I2C with Audio lib running

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    5

    can I use pins A4+A5 for I2C with Audio lib running

    I want to read time from an RTC breakout board on pins A4 and A5 but I am running the Audio Lib to do fft1024 on pin A2. Will this cause a conflict like analog read does? I would just use pins A18 and A19 but I have the TEENSY soldered to a proto board and can't access the bottom side of the board. Adding the RTC to the project is an expansion or I would have used the bottom pins to begin with, I would rather not have to desolder everything if possible. BTW I am using a TEENSY 3.2 .

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,377
    A4 and A5 can be used for I2C on teensy just like UNO
    You should also be using the i2c_t3 library with your teensy, don't include Wire.h
    Last edited by tonton81; 12-18-2016 at 02:27 PM.

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,906
    If you use the Audio Shield - no, it expects I2C on Pins 18/19
    Otherwise, yes.

  4. #4
    Junior Member
    Join Date
    Oct 2016
    Posts
    5
    I should have added that I am not using the Audio shield. I am running a line input through the DC biasing circuit shown on the audio design page and into ADC0 through pin A2.

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,743
    If you are not connecting the audio shield to pins A4/A5, you probably need to add 2.2/2.4K pull-up resistors between each of pin 18/A4 and 19/A5 to the 3.3v line (i.e. two resistors, each connecting one of the pins to the 3.3v line). If you mount the audio shield directly on the Teensy (or connect A4/A5 to the appropriate pins), the audio shield provides the necessary pull-up resistors. Note, you will need i2c to access the SGTL5000 (i2c id 0x0a) and WM8731 (i2c id 0x1a) on the audio shield.

    If you have something else that provides pull-up resistors, you don't need to add additional resistors.

    Note, assuming you connect a 32.768K crystal to the Teensy and power the Vbat pin/ground with a coin battery, the Teensy 3.2 has its built-in RTC that you can use. http://pjrc.com/teensy/td_libs_Time.html#teensy3

    Finally, some of the RTC's offered for use with the Arduinos were 5v only. If your RTC is 5v only, you will need level shifters for both i2c pins.

Posting Permissions

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