<?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>Processor Expert SoftwareのトピックPCF85263A  RTC issue</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/PCF85263A-RTC-issue/m-p/1645904#M5553</link>
    <description>&lt;P&gt;we are using external RTC PCF85263A for PIC32MM0256GPM064 microcontroller .we faced issues utilizing PCF85263A.&lt;/P&gt;&lt;P&gt;we tried to updated the time in RTC.it was successfull but the time is not incremented .&lt;/P&gt;&lt;P&gt;we changed the rtc.it was not work.&lt;BR /&gt;kindly suggest the solutions for RTC issue.&lt;/P&gt;&lt;P&gt;#include &amp;lt;xc.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define &lt;STRONG&gt;I2Cwrite&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0xA2&lt;BR /&gt;#define &lt;STRONG&gt;I2CRead&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0xA3&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;void I2C_wait_for_idle(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;while(I2C3CON &amp;amp; 0x1F);&lt;BR /&gt;while(I2C3STATbits.TRSTAT);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;void I2C_start()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.SEN = 1;&lt;BR /&gt;while (I2C3CONbits.SEN == 1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_stop()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.PEN = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_restart()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.RSEN = 1;&lt;BR /&gt;while (I2C3CONbits.RSEN == 1);&lt;BR /&gt;}&lt;BR /&gt;&lt;STRONG&gt;void I2C_ack(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.ACKDT = 0;&lt;BR /&gt;I2C3CONbits.ACKEN = 1;&lt;BR /&gt;while(I2C3CONbits.ACKEN);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_nack(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.ACKDT = 1;&lt;BR /&gt;I2C3CONbits.ACKEN = 1;&lt;BR /&gt;while(I2C3CONbits.ACKEN);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2c_write(unsigned char address, char wait_ack)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C3TRN = address | 0;&lt;BR /&gt;while (I2C3STATbits.TBF == 1);&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;if (wait_ack) while (I2C1STATbits.ACKSTAT == 1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2c_read(unsigned char *value, char ack_nack)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C3CONbits.RCEN = 1;&lt;BR /&gt;while (I2C3CONbits.RCEN);&lt;BR /&gt;while (!I2C3STATbits.RBF);&lt;BR /&gt;*value = I2C3RCV;&lt;/P&gt;&lt;P&gt;if (!ack_nack)&lt;BR /&gt;I2C_ack();&lt;BR /&gt;else&lt;BR /&gt;I2C_nack();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_Initialize()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;LATC = 0x00;&lt;BR /&gt;ANSELBbits.ANSB13 = 0;&lt;BR /&gt;TRISBbits.TRISB13 = 1;&lt;BR /&gt;TRISBbits.TRISB7 = 1;&lt;BR /&gt;I2C3CONbits.ON = 1;&lt;BR /&gt;I2C3CONbits.DISSLW = 1;&lt;BR /&gt;I2C3BRG = 7;&lt;BR /&gt;I2C3STAT = 0x0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void PCF85263_write(unsigned char reg_address, unsigned char value)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_start();&lt;BR /&gt;I2c_write(I2Cwrite , 1);&lt;BR /&gt;I2c_write(reg_address,1);&lt;BR /&gt;I2c_write(value,1);&lt;BR /&gt;I2C_stop();&lt;BR /&gt;}&lt;BR /&gt;&lt;STRONG&gt;void PCF85263_read(unsigned char reg_address, unsigned char *value)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_start();&lt;BR /&gt;I2c_write(I2Cwrite , 1);&lt;BR /&gt;I2c_write(reg_address,1);&lt;BR /&gt;I2C_restart();&lt;BR /&gt;I2c_write( I2CRead ,1);&lt;BR /&gt;I2c_read(value, 1);&lt;BR /&gt;I2C_stop();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void rtc_read()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCF85263_read(0x2E, &amp;amp;value);&lt;BR /&gt;PCF85263_read(0x28, &amp;amp;data);&lt;BR /&gt;PCF85263_read(0x01, &amp;amp;sec);&lt;BR /&gt;PCF85263_read(0x02, &amp;amp;min);&lt;BR /&gt;PCF85263_read(0x03, &amp;amp;hours);&lt;BR /&gt;PCF85263_read(0x04, &amp;amp;date);&lt;BR /&gt;PCF85263_read(0x05, &amp;amp;day);&lt;BR /&gt;PCF85263_read(0x06, &amp;amp;month);&lt;BR /&gt;PCF85263_read(0x07, &amp;amp;years);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void rtc_write()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCF85263_write(0x2E, 0x01);&lt;BR /&gt;PCF85263_write(0x28, 0xA4);&lt;BR /&gt;PCF85263_write(0x01, 0x00);&lt;BR /&gt;PCF85263_write(0x02, 0x00);&lt;BR /&gt;PCF85263_write(0x03, 0x00);&lt;BR /&gt;PCF85263_write(0x04, 0x05);&lt;BR /&gt;PCF85263_write(0x05, 0x06);&lt;BR /&gt;PCF85263_write(0x06, 0x05);&lt;BR /&gt;PCF85263_write(0x07, 0x23);&lt;BR /&gt;PCF85263_write(0x2E, 0x00);&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 06 May 2023 08:02:48 GMT</pubDate>
    <dc:creator>Thenmozhi</dc:creator>
    <dc:date>2023-05-06T08:02:48Z</dc:date>
    <item>
      <title>PCF85263A  RTC issue</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/PCF85263A-RTC-issue/m-p/1645904#M5553</link>
      <description>&lt;P&gt;we are using external RTC PCF85263A for PIC32MM0256GPM064 microcontroller .we faced issues utilizing PCF85263A.&lt;/P&gt;&lt;P&gt;we tried to updated the time in RTC.it was successfull but the time is not incremented .&lt;/P&gt;&lt;P&gt;we changed the rtc.it was not work.&lt;BR /&gt;kindly suggest the solutions for RTC issue.&lt;/P&gt;&lt;P&gt;#include &amp;lt;xc.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define &lt;STRONG&gt;I2Cwrite&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0xA2&lt;BR /&gt;#define &lt;STRONG&gt;I2CRead&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0xA3&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;void I2C_wait_for_idle(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;while(I2C3CON &amp;amp; 0x1F);&lt;BR /&gt;while(I2C3STATbits.TRSTAT);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;void I2C_start()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.SEN = 1;&lt;BR /&gt;while (I2C3CONbits.SEN == 1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_stop()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.PEN = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_restart()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.RSEN = 1;&lt;BR /&gt;while (I2C3CONbits.RSEN == 1);&lt;BR /&gt;}&lt;BR /&gt;&lt;STRONG&gt;void I2C_ack(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.ACKDT = 0;&lt;BR /&gt;I2C3CONbits.ACKEN = 1;&lt;BR /&gt;while(I2C3CONbits.ACKEN);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_nack(void)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;I2C3CONbits.ACKDT = 1;&lt;BR /&gt;I2C3CONbits.ACKEN = 1;&lt;BR /&gt;while(I2C3CONbits.ACKEN);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2c_write(unsigned char address, char wait_ack)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C3TRN = address | 0;&lt;BR /&gt;while (I2C3STATbits.TBF == 1);&lt;BR /&gt;I2C_wait_for_idle();&lt;BR /&gt;if (wait_ack) while (I2C1STATbits.ACKSTAT == 1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2c_read(unsigned char *value, char ack_nack)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C3CONbits.RCEN = 1;&lt;BR /&gt;while (I2C3CONbits.RCEN);&lt;BR /&gt;while (!I2C3STATbits.RBF);&lt;BR /&gt;*value = I2C3RCV;&lt;/P&gt;&lt;P&gt;if (!ack_nack)&lt;BR /&gt;I2C_ack();&lt;BR /&gt;else&lt;BR /&gt;I2C_nack();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void I2C_Initialize()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;LATC = 0x00;&lt;BR /&gt;ANSELBbits.ANSB13 = 0;&lt;BR /&gt;TRISBbits.TRISB13 = 1;&lt;BR /&gt;TRISBbits.TRISB7 = 1;&lt;BR /&gt;I2C3CONbits.ON = 1;&lt;BR /&gt;I2C3CONbits.DISSLW = 1;&lt;BR /&gt;I2C3BRG = 7;&lt;BR /&gt;I2C3STAT = 0x0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void PCF85263_write(unsigned char reg_address, unsigned char value)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_start();&lt;BR /&gt;I2c_write(I2Cwrite , 1);&lt;BR /&gt;I2c_write(reg_address,1);&lt;BR /&gt;I2c_write(value,1);&lt;BR /&gt;I2C_stop();&lt;BR /&gt;}&lt;BR /&gt;&lt;STRONG&gt;void PCF85263_read(unsigned char reg_address, unsigned char *value)&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;I2C_start();&lt;BR /&gt;I2c_write(I2Cwrite , 1);&lt;BR /&gt;I2c_write(reg_address,1);&lt;BR /&gt;I2C_restart();&lt;BR /&gt;I2c_write( I2CRead ,1);&lt;BR /&gt;I2c_read(value, 1);&lt;BR /&gt;I2C_stop();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void rtc_read()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCF85263_read(0x2E, &amp;amp;value);&lt;BR /&gt;PCF85263_read(0x28, &amp;amp;data);&lt;BR /&gt;PCF85263_read(0x01, &amp;amp;sec);&lt;BR /&gt;PCF85263_read(0x02, &amp;amp;min);&lt;BR /&gt;PCF85263_read(0x03, &amp;amp;hours);&lt;BR /&gt;PCF85263_read(0x04, &amp;amp;date);&lt;BR /&gt;PCF85263_read(0x05, &amp;amp;day);&lt;BR /&gt;PCF85263_read(0x06, &amp;amp;month);&lt;BR /&gt;PCF85263_read(0x07, &amp;amp;years);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void rtc_write()&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCF85263_write(0x2E, 0x01);&lt;BR /&gt;PCF85263_write(0x28, 0xA4);&lt;BR /&gt;PCF85263_write(0x01, 0x00);&lt;BR /&gt;PCF85263_write(0x02, 0x00);&lt;BR /&gt;PCF85263_write(0x03, 0x00);&lt;BR /&gt;PCF85263_write(0x04, 0x05);&lt;BR /&gt;PCF85263_write(0x05, 0x06);&lt;BR /&gt;PCF85263_write(0x06, 0x05);&lt;BR /&gt;PCF85263_write(0x07, 0x23);&lt;BR /&gt;PCF85263_write(0x2E, 0x00);&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2023 08:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/PCF85263A-RTC-issue/m-p/1645904#M5553</guid>
      <dc:creator>Thenmozhi</dc:creator>
      <dc:date>2023-05-06T08:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: PCF85263A  RTC issue</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/PCF85263A-RTC-issue/m-p/1645987#M5554</link>
      <description>&lt;P&gt;I'm using the PCF85063A, but I thing your device is similar.&lt;/P&gt;&lt;P&gt;The CTRL register has a STOP bit which stops/disables the clock.&lt;/P&gt;&lt;P&gt;See for example my implementation here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/src/McuPCF85063A.c" target="_blank"&gt;https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/src/McuPCF85063A.c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So check your data sheet for a STOP bit and check the setting of this bit.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2023 14:25:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/PCF85263A-RTC-issue/m-p/1645987#M5554</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-05-07T14:25:11Z</dc:date>
    </item>
  </channel>
</rss>

