energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
794 stars 672 forks source link

Allow I²C 400-kHz Fast-mode (Fm) #282

Closed rei-vilo closed 7 years ago

rei-vilo commented 10 years ago

Allow I²C 400-kHz Fast-mode (Fm)

Luis-R-A commented 10 years ago

Is this for the msp430 or for stellaris? For stellaris you can use: http://forum.stellarisiti.com/topic/1592-energia-library-i2c-api-on-energia/

rei-vilo commented 10 years ago

Thanks.

For both, as mentioned in the labels.

dspdon commented 8 years ago

I realize this Issue is 2+ yrs old ... I'm failing to compile legacy Arduino code that calls Wire.setClock(400000U) to achieve Fm I2C with Energia IDE. I'm using (trying to use) RBL CC3200 WiFi device. The branch #343 seems specific to Stellaris, not the CC3200 I'm using (e.g., the Wire lib I just installed doesn't have the setClock definition).

rei-vilo commented 8 years ago

If you're using I²C in slave mode, it sets itself automatically to standard mode (100 kHz), fast mode (400 kHz) and fast mode plus (1 MHz).

dspdon commented 8 years ago

Right: an I2C slave (e.g., a sensor such an accelerometer) reacts to the clock generated by an I2C master. But an I2C master (e.g., a CC3200 talking to the sensor) generates the clock and must have that rate explicitly specified if it's not the default. That's what Wire.setClock(rate) does, and is missing from Energia CC3200 Wire lib. If you've set 400kHz or higher I2C rates on this platform, let me know how you achieved that. That would be the code needed to implement setClock...

robertinant commented 7 years ago

This issue was moved to energia/tivac-core#36