<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with reading RTC data continuoulsy in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-with-reading-RTC-data-continuoulsy/m-p/629184#M13444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Taj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you should check with Maxim how exactly does the DS1307 RTC operates.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.maximintegrated.com/en/products/digital/real-time-clocks/DS1307.html" title="https://www.maximintegrated.com/en/products/digital/real-time-clocks/DS1307.html"&gt;DS1307 64 x 8, Serial, I²C Real-Time Clock - Maxim&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is normal. After each read or write, in case there isn't auto-incrementing address register, you should generate stop condition and then start all over again:&lt;/P&gt;&lt;P&gt;- generate start condition,&lt;/P&gt;&lt;P&gt;- call RTC (slave address),&lt;/P&gt;&lt;P&gt;- send register address,&lt;/P&gt;&lt;P&gt;- read or write register,&lt;/P&gt;&lt;P&gt;- generate stop condition.&lt;/P&gt;&lt;P&gt;If you put this in a loop, there you can have continuous reading of the time register. Here is a code snippet that can be of help:&lt;/P&gt;&lt;P&gt;//=============================================&lt;/P&gt;&lt;P&gt;for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;IIC0IBCR_MS_SL = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Generate START condition&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//------------------------------ CALL RTC DEVICE -----------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;IIC0IBDR = 0xA2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Load slave address into IIC data register&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBB){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for flag to set indicating the bus is busy&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;//---------------------------- SEND DATA BYTE TO RTC -------------------------------&lt;BR /&gt;&amp;nbsp;IIC0IBDR = RegAddr;&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//---------------------------- R/W DATA BYTE FROM/TO RTC -------------------------------&lt;BR /&gt;&amp;nbsp;IIC0IBDR = ReadRegData;&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IIC0IBCR_MS_SL = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Generate STOP condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;small_delay();&amp;nbsp; //may not be necessary&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//=============================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the information helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;iggi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2016 12:55:30 GMT</pubDate>
    <dc:creator>iggi</dc:creator>
    <dc:date>2016-10-13T12:55:30Z</dc:date>
    <item>
      <title>Problem with reading RTC data continuoulsy</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-with-reading-RTC-data-continuoulsy/m-p/629183#M13443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I interfaced DS1307 I2C RTC with 9s12XDP512. I am able to write and read time information. But to read time continuously i had to write again the register address after first read operation. i generated stop condition in first read and again start in second read. Now it is showing as bus busy(IBB) in the second read operation which it should not occur after MS_SL=0 (stop condition) in first time read.&lt;/P&gt;&lt;P&gt;Can anybody tell how to resolve it??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 01:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-with-reading-RTC-data-continuoulsy/m-p/629183#M13443</guid>
      <dc:creator>tajmohammadsayy</dc:creator>
      <dc:date>2016-10-13T01:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with reading RTC data continuoulsy</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-with-reading-RTC-data-continuoulsy/m-p/629184#M13444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Taj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you should check with Maxim how exactly does the DS1307 RTC operates.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.maximintegrated.com/en/products/digital/real-time-clocks/DS1307.html" title="https://www.maximintegrated.com/en/products/digital/real-time-clocks/DS1307.html"&gt;DS1307 64 x 8, Serial, I²C Real-Time Clock - Maxim&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is normal. After each read or write, in case there isn't auto-incrementing address register, you should generate stop condition and then start all over again:&lt;/P&gt;&lt;P&gt;- generate start condition,&lt;/P&gt;&lt;P&gt;- call RTC (slave address),&lt;/P&gt;&lt;P&gt;- send register address,&lt;/P&gt;&lt;P&gt;- read or write register,&lt;/P&gt;&lt;P&gt;- generate stop condition.&lt;/P&gt;&lt;P&gt;If you put this in a loop, there you can have continuous reading of the time register. Here is a code snippet that can be of help:&lt;/P&gt;&lt;P&gt;//=============================================&lt;/P&gt;&lt;P&gt;for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;IIC0IBCR_MS_SL = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Generate START condition&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//------------------------------ CALL RTC DEVICE -----------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;IIC0IBDR = 0xA2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Load slave address into IIC data register&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBB){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for flag to set indicating the bus is busy&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;//---------------------------- SEND DATA BYTE TO RTC -------------------------------&lt;BR /&gt;&amp;nbsp;IIC0IBDR = RegAddr;&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//---------------------------- R/W DATA BYTE FROM/TO RTC -------------------------------&lt;BR /&gt;&amp;nbsp;IIC0IBDR = ReadRegData;&lt;BR /&gt;&amp;nbsp;while(!IIC0IBSR_IBIF){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for data transfer complete (TCF bit set)&lt;BR /&gt;&amp;nbsp;IIC0IBSR_IBIF=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This bit must be cleared by SW, write a one to it&lt;BR /&gt;&amp;nbsp;while(IIC0IBSR_RXAK){}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for acknowledge from slave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IIC0IBCR_MS_SL = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Generate STOP condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;small_delay();&amp;nbsp; //may not be necessary&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//=============================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the information helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;iggi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 12:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-with-reading-RTC-data-continuoulsy/m-p/629184#M13444</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2016-10-13T12:55:30Z</dc:date>
    </item>
  </channel>
</rss>

