[ATSAMD11] - I2C only works during breakpoint debug mode

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hello lovely people,

 

I have an interesting problem. I've programmed my own I2C master driver and it appears to be able to talk to an IC on my PCB, as I can step through the code and read registers fine.

The problem comes when I launch the program without debugging, I have a piece of codes that reads back a value and if it matches it turns on an LED.



Now, this works when I'm stepping through, but when I launch without, it doesn't work.

 

What could cause this? My immediate thoughts are maybe I set up the clock wrong and it's too fast normally? I've tried playing with the BAUD register value to no avail.

 

Here is my code for I2C init and read:

 

 

Thanks in advance for helping me! :)