Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 months ago.
Why i cant R/W?
My RTC from sparkfun (same model) works well with Arduino. But I can`t seem to get it to work with Mbed I get error on R/W operations both read and write.
The i2c cables are linked from p28 and p27 for Data and Clock respectively. Any help appreciated it.
Copy from Terminal:
seconds set are 24 min set are 13 hour set are 13 day set are 04 date set are 20 month set are 06 year set are 12 Last R/W operation failed! seconds read are 24 min read are 13 hour read are 13 day read are 04 date read are 20 month read are 06 year read are 12 Last R/W operation failed! Value written to register 0x20 39 Last R/W operation failed! Value read from register 0x20 00
Question relating to:
1 Answer
9 years, 11 months ago.
Are the pull-ups installed on SDA and SCL?
Some resistors from those lines to 5v? No. I thought it already had them on the rtc board. Never used them on arduino. Is it different on mbed? Sorry I just got it today.
posted by 23 Dec 2014The pull-up resistors are definitely needed on LPC1768 mbed. They should be around 4K7 each and pull-up voltage should be 3V3 instead on 5V. Not sure which RTC board you use. It could have them onboard in which case you dont need additional ones. Also make sure that you have common ground.
posted by 23 Dec 2014Thank you Wim, I am using exactly the board that the OP Philip posted on the original code.
http://www.sparkfun.com/products/99
Ive tried with 220, 330, 1k, 2k, 4k and still dont get any response. I find it very strange since this RTC breakout works just fine without anything in Arduino. I am using the p9,p10 for DAT and CLK and also change to 28, 27, and nothing also made sure its set to address 0x68. But I have no idea what am I doing wrong.
Thank you so much for taking the time to respond.
After playing around, I finally have it working using 4.2kΩ on a 5.0v line. Also managed to plug in a OLED on i2c. Also, the address also was 0xD0 for this RTC module.
posted by 25 Dec 2014