Okay.
So I modified the code as this:Maybe it doesn't make a lot of sense to put the PIC in low-power mode. How is it done in the "industrial" life?Code:<html><head></head><body><!--StartFragment--><pre><code><font color="#000080"><i>' PIC16F630 Fuses </i></font><font color="#008000">@ DEVICE WDT_ON </font><font color="#000080"><i>'------------------------------------------------------------------------------- ' Registers 76543210 </i></font>WPUA = %00110100 <font color="#000080"><i>'Weak Pull-up of PORTA for SCL and SDA on DS1307 </i></font>TRISA = %00000100 <font color="#000080"><i>'Set Input/Output '------------------------------------------------------------------------------- ' Variables </i></font>DSOut <b>VAR </b>PORTA.2 <font color="#000080"><i>'DS1307 SQW pin #7 '------------------------------------------------------------------------------- </i></font>MAIN: <b>IF </b>DSOut = 0 <b>THEN GOSUB </b>Read_1307 <font color="#000080"><i>'Read the time & date </i></font><b>GOSUB </b>lcd <font color="#000080"><i>'put PIC in low-power mode for 576+288+72=936ms </i></font><b>NAP </b>5 <b>NAP </b>4 <b>NAP </b>2 <b>ENDIF GOTO </b>MAIN: <b>END </b></code></pre><!--EndFragment--></body> </html>




Bookmarks