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

Thread: I2C Slave will not send data to master when requested

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    4

    I2C Slave will not send data to master when requested

    Hi,

    I have a simple master and slave code for two teensy 3.6 devices which are communicating via i2c. The master sends the slave the slave address, then 0xAA, and requests the slave to send 3 bytes of data in return. The slave does not send data in response. Can someone provide me insight as to why the slave device does not send data to the master? The master and slave code is included below.

    MASTER.inoSLAVE.ino



    Thank you so much,

    Sam

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,386
    How do the SDA and SCL signals look on the oscilloscope? Which value are you using for the pull-up resistors? Do the two teensys have a common ground?

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    4
    Quote Originally Posted by Theremingenieur View Post
    How do the SDA and SCL signals look on the oscilloscope? Which value are you using for the pull-up resistors? Do the two teensys have a common ground?
    Hi,

    I have attached an oscilloscope screenshot that shows how the master and slave are interacting. The yellow waveform is the data line, and the green waveform is the clock signal. I am using 4.7 kOhm pull up resistors. The teensys do share a common ground.

    Click image for larger version. 

Name:	scope_0.png 
Views:	10 
Size:	52.9 KB 
ID:	16102

  4. #4
    Senior Member
    Join Date
    Feb 2017
    Posts
    279
    Did you try adding debug prints to see if the actually gets the request?

Posting Permissions

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