In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mumcs01 wrote: I'm doing a number of reads from an i2c clock, and it seems, on a hard reboot sometimes this read is getting cut short and operating as a write, scrambling things up. Below is the subroutine I made which is getting run 10 times in a row. [code] sub rtc_read_byte temp2 = __PARAM1 i2cstart RtcSda temp = RtcId temp.0 = 0 i2csend rtcsda, temp i2csend rtcsda, temp2 i2cstart RtcSda temp = RtcId temp.0 = 1 i2csend rtcsda, temp i2cRecv rtcsda, temp, Nak i2cstop rtcsda ' I think this below pause fixed it. pause 30 return temp endsub [/code] Notice the pause I added, which seemed to solve this. My questions is, is there a mimimum time I should be waiting inbetween subsiquent read and write operations? I seem to remember hearing something like this before? Anyone know the minimum, or at least someone else seen this? It only seems to a happen after a hard reboot and on the FIRST read. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=307676 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)