chipKIT® Development Platform

Inspired by Arduino™

I2C bus speed change in a sketch for uC32 board

Created Tue, 08 Sep 2015 09:33:26 +0000 by robypaolo1


robypaolo1

Tue, 08 Sep 2015 09:33:26 +0000

Hello,

can anyone suggest a method for changing the I2C bus speed from 100kHz to 400kHz by putting a few lines of code in a sketch? I am using an uC32 board, A4 --> SDA and A5 --> SCL

Thank you for the help!


Gary Freegard

Tue, 03 Nov 2015 15:38:44 +0000

Hi

You should look at the manual,[url]http://ww1.microchip.com/downloads/en/DeviceDoc/61116F.pdf[/url]

The register you need is I2CxBRG which is used to control the speed.

Also have a look at [url]http://chipkit.net/forum/viewtopic.php?f=7&t=1206&p=5312&hilit=i2c+uno#p5312[/url], where xray_drifter managed to get I2C running at 1MHz

Good luck

Gary