ATSAMD10D13AS I2C with arduino mkr gsm 1400

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

Is pin PA15 somehow connected to using I2C on pins PA22 and PA23? The code works fine, but after every i2c transaction I am supposed to put some pins to input, one of them is PA15. It works fine for a couple of times, however after a while (5 transactions ~2 mins), SAMD10 gets stuck and is no longer reading I2C data, which in turn means that the MKR is stuck waiting for a ACK.  Outside of I2C, I'm only using PWM on pin 16. Any ideas on why this happens?

 

I'm using ataradov's samd10 starter project, mostly hal_gpio.h to define and swap pin states. I'll post the whole code below but there is a bunch of thing and I don't really expect anyone to go through it.

 

 

Attachment(s): 

This topic has a solution.
Last Edited: Mon. Aug 8, 2022 - 07:27 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK I figured it out PIN 16 and 15 share the PMUX register so setting the counter to pin 16 somehow blocks pin 15 from being changed to input. If I disable TCC0 before changing pin 15 to input everything works fine