dspdon 0 Posted January 22, 2016 Share Posted January 22, 2016 I am failing to compile some legacy Arduino projects that call Wire.setClock() (or Wire.setSpeed()). Are these unsupported in the Energia IDE library implementations? I looked but didn't find them in $\hardware\cc3200\libraries\Wire\Wire.c or Wire.h. How else to set 400kHz I2C operation (vs default 100 kHz)? --Don Quote Link to post Share on other sites
spirilis 1,265 Posted January 22, 2016 Share Posted January 22, 2016 I didn't know Arduino had that! Seems like it would be a good thing to add. Quote Link to post Share on other sites
dspdon 0 Posted January 22, 2016 Author Share Posted January 22, 2016 A review of Arduino Wire lib shows the public declaration: void setClock(uint32_t); and something rather hardware-specific in the implementation, e.g., void TwoWire::setClock(uint32_t frequency) { TWBR = ((F_CPU / frequency) - 16) / 2; // <-- specific to AVR } I'm new to the RBL CC3200 device I'm attempting to bring-up. If anyone has modified the I2C bus speed on this device, I'll be happy to get your input. My need is for a write-once setting at system initialization, nothing dynamic. Quote Link to post Share on other sites
khoi 2 Posted January 29, 2016 Share Posted January 29, 2016 Hi there. In function Wire.begin You can find ROM_I2CMasterInitExpClk(MASTER_BASE, F_CPU, false) set it to ROM_I2CMasterInitExpClk(MASTER_BASE, F_CPU, true) for 400khz Fmilburn and bluehash 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.