real time clock


Closed Thread
Results 1 to 40 of 45

Thread: real time clock

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    when i use this code, with a serout commando the compiler give a error on the code HEX2.

    And when i leave the HEX2 in the serout and replace them bij # the counting gives problems what does the hex2 does, and how can i display the time and date on a console pc with the serout command?

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    RTFM

    There is no HEX modifier with SEROUT, use SEROUT2 instead.

    see PBP Manual Section 5.73 & 5.74
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3


    Did you find this post helpful? Yes | No

    Default

    already fix the problem use the and and shift >>4 function

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Hey CocaColaKid, thanx for the code it worked, however, I suggest an improvement as stated in the DS1302 datasheet U R supposed to read
    the seconds again at the end in case the second ticks over from 59 to
    00 while you were reading the mins, hrs, etc. this could result in erroneous
    Real Time reading.

    Suggest modification here:
    ss var byte 'seconds
    ss2 var byte 'seconds comparison byte

    start:
    reg_adr = readsec ' Read seconds
    gosub w_in
    ss = mem
    reg_adr = readmin ' Read minutes
    gosub w_in
    mm = mem
    reg_adr = readhour ' Read Hours
    gosub w_in
    hh = mem
    reg_adr = readyear ' Read Year
    gosub w_in
    yr = mem
    reg_adr = readdate ' Read Date
    gosub w_in
    date = mem
    reg_adr = readmonth ' Read Month
    gosub w_in
    mo = mem
    reg_adr = readsec ' Read seconds
    gosub w_in
    ss2 = mem
    IF ss <> ss2 THEN start 'COMPARE FIRST AND SECOND READINGS AND TRASH IF DIFFERENT.
    lcdout $fe,1,"TIME:",HEX2 hh,":",HEX2 mm,":",HEX2 ss
    pause 500
    goto start

    Cheers, Art.

  5. #5
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: real time clock

    yes it does change the input /output of the tris control , how ever it not documented in any of the manuals or online help files that i have found to date

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