real time clock


Closed Thread
Results 1 to 40 of 45

Thread: real time clock

Hybrid View

  1. #1
    bahattinkor's Avatar
    bahattinkor Guest


    Did you find this post helpful? Yes | No

    Smile Problem with DS1302 and Proton+

    dear friends,

    I have a problem with the DS1302, PIC16f877 and PIC Proton+ combination. I designed a basic circuit in PROTEUS, and put your code in it. I worked fine. There was no problem. but when I made that circuit real, I met with problems. When I powered the PIC I can not see the time runing. The only thing that I see is " 00:00:80" and it always stays same. I used portd.0,d1 and d2 in the connection of PIc and DS1302. I used 32.768khz crystal. And there is no any mistake in connections. How can I fix this problem ?
    And one more small question. How can I reset LCD ? in PicBasic PRo I used to written "Flags=0". In Proton+ what should I write instead of this ?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    For info on Proton... www.picbasic.org/forum

    I doubt PROTON have this option or it's hidden somewhere in the Help file, or somewhere on the forum.

    BUT try
    Code:
    Print $fe,$28 
    Print $fe,$0c 
    Print $fe,1
    This should work
    Last edited by mister_e; - 27th July 2005 at 03:38.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    bot402's Avatar
    bot402 Guest


    Did you find this post helpful? Yes | No

    Default

    You should know better than that Steve. The PROTON does everything the PBP does, and a whole lot more!

    To reset the LCD, simply use: -

    Dim BPF as Byte SYSTEM ' Bring the system variable into BASIC

    Clear BPF ' Force a reset on the LCD the next time it's used

    However, this is the wrong forum for the PROTON compiler. As long as your not using a pirated version of the compiler, you are welcome to use the dedicated PROTON forum

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello bahattinkor,

    I had the same problem for 2 days using a DS1337. It displayed the default time and if I programmed a new starting time that would display but would continue from there. This was on a printed circuit board that was already working but had a little accident with a floating wire that went into the side of the power supply box and blew everything up! After replacing most of the parts the board worked for a few days then quit. I put new chips on the board again but to no gain. I put all of the same parts into a newer board and they worked fine. Went back to the old board and found no connection between one side of the crystal and the DS 1337.

    The moral of this story is triple check your connections and use a meter!

    BobK

  5. #5
    bahattinkor's Avatar
    bahattinkor Guest


    Did you find this post helpful? Yes | No

    Unhappy Still not working

    yes, I checked connections. voltages are normal but when I measured the cyrstal of Ds1302 with ossiloscope, I did not see any frequency. The ossilator does not ossilates. then I change DS1302 and 32.768Khz cyrstal with new ones but they are still not working. Can it be related with the Vcc that I used. I use 5V for Vcc for DS1302. Or Should I use any resistor or capacitor plus for the DS1302.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Probably your Clock Halt flag is set..... it's undetermined when you put power on the RTC. Just clear this bit and you'll see oscillation on your scope.
    The problem is the same on many RTC. See the secondes register for the CH bit.

    Many cheaper probe will screw the signal coming from an Crystal. Place it on 10X and this will help a bit in many case.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Cool RTC - DS1302 with User Interface

    Here is a modified version of the code posted by CocaColaKid above.

    In the code above, the clock can only be set during the programming of PIC.

    With the modification here, the user can set the time, date etc. at any given time.

    Advise/post any additions, recommendations, modifications etc if any.
    Attached Images Attached Images  
    Attached Files Attached Files

Similar Threads

  1. Real Time Clock
    By in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd June 2012, 04:52
  2. real time clock - PCF8583
    By maria in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 15th April 2010, 15:41
  3. Real time clock ICs
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 66
    Last Post: - 20th October 2008, 16:05
  4. Real Time Clock
    By savnik in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th December 2006, 02:02
  5. Real time clock... what a headache!
    By Eng4444 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 8th June 2006, 21:56

Members who have read this thread : 3

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts