SAMD20 I2C not working on Sercom 2/4.

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I have a custom board using a SAMD20. I  have two USART ports and two I2C ports. Both USARTs work fine. The I2C ports are on SERCOM 2 and 4. Neither of them work.

 

The I2C ports are operating in Slave mode and configured with 1MHz core clock and 32KHz slow clock. By sampling the respective PAxx pins in FW I have confirmed that I2C input pins are toggling whenever I2C data is present on the I2C bus. We are using a level converter to convert 3.2Volts I2C signal to 1.8 volts I2C signal which is then fed to SAMD20.

 

I have used the Atmel Start project to configure the project. I have tried using Async and sync modes. But I still can't get I2C to work.

 

Any pointers on what I could be doing wrong or on how I should proceed to debug this issue?

 

thanks

Mia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that only a limited number of pins are I2C capable - have you confirmed that the "respective PAxx pins" are actually I2C capable?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi awneil

I went through the SAMD20 datasheet and it says PA08-09 and PA12-13 are I2C capable. These are the pair of pins I'm using for my I2C commuication.

PA12-13 is I2C_0, SERCOM4, slave mode

PA08-09 is I2C_1, SERCOM2, slave mode

I have still not be able to get I2C to work. I have verified that the data placed on the I2C bus by the I2C master is correct (i.e the address is correct, and it is a write operation). However I don't see any ACKs on the bus.

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello

I know this is for D21 but maybe it will help you. I read this application note and according to it I set up my I2C slave program

Attachment(s):