TRIS setting for the DS1302


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default news

    @ Steve

    I think I may have found the problem ....
    It looks like I am using a 32.768 Mhz Crystal not a 32.768Khz one!
    Will get 32.768 Khz crystals tomorrow and confirm :-)

    Thanks a million for the info thus far :-)

    Kind regards

    Dennis

  2. #2
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Ahhh, yes... the wrong xtal would do it.

    No amount of fooling with code and registers will help if the hardware is broken.

    Last week I spent 2 hours looking over a data sheet to see what registers and settings were wrong when I couldn't get a new circuit to work.
    The problem turned out to be 1 unsoldered pin on a 44TQFP part...

    Let us know how it goes with the right xtal.


    steve

  3. #3


    Did you find this post helpful? Yes | No

    Default It's working....!

    YAY it works :-)

    @ Steve .... :-) so easy to miss a pin soldering sometimes or on a breadboard test even forget to put the PIC back into its socket after programming and then watching a blank serial debugger screen :-)
    I remember years back in a PC workshop two of the technicians ,on inspection of a 'DEAD PC' that just arrived in, meticulously tested and replaced every component and card (drives,motherboard ,etc) in the PC including the case, eventually out of sheer frustration they called me in to check why it was still dead and the customer had been waiting nearly two weeks for their PC.
    I checked the power cable first ... it was plugged into the PSU but it was on a long workbench so I followed the cable to its source... and there was the problem ...the mains switch for the wall plug was OFF :-)

    Sometimes even the obvious is not so obvious and often we are in a huge rush, excited to get to the end result as soon as we can.

    Thanks Steve and everyone else for all the help so far, I really appreciate it !

    Kind regards

    Dennis

  4. #4


    Did you find this post helpful? Yes | No

    Default Now to add an alarm...

    @Steve

    To add an alarm(s) , would I just store a date and time in flash and then use an IF ..THEN statement as a matching trigger ?

    Kind regards

    Dennis

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


    Did you find this post helpful? Yes | No

    Smile

    Hi Dennis,

    You could do that or you could use the DS1337 that has 2 alarms built-in.
    The DS1337 uses I2C communications and can be configured in several
    different ways. Several years ago, Tony Galea presented an entire program
    using the DS1337. Recently, JEllis posted his trials setting up this clock.
    It doesn't have a battery charger like the DS1302 but it does have two separate alarm outputs. If you only need one alarm and need a 1hz pulse, the DS1337 will fill your needs. Check out the data sheet. I use alot of them and have a backup battery circuit for them.

    HTH,

    BobK

  6. #6
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Or you could just use a 18F46J50 that has a RTCC built in.
    *None* of that serial communications junk that way, eh?

    I still continue to use the DS1302 for a lot of projects because I LIKE the "keep alive battery" and charger...

  7. #7
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dennis View Post
    @Steve

    To add an alarm(s) , would I just store a date and time in flash and then use an IF ..THEN statement as a matching trigger ?

    Kind regards

    Dennis
    Sure.
    Store an alarm hour and and minute (and day if you want), and IF "current minute" >= "alarm minute" AND "current hour" >= "alarm hour" THEN gosub makeahelluvanoise.


    steve

Similar Threads

  1. real time clock
    By maria in forum Code Examples
    Replies: 44
    Last Post: - 1st March 2022, 12:13
  2. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  3. DS1302 16F628 Woes
    By idtat in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th January 2009, 14:15
  4. TRIS E setting for 18F2550
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd May 2007, 07:47
  5. Is LCDOUT setting always al TRIS ?
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th June 2005, 17:02

Members who have read this thread : 1

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