Making a timer, 32.768kHz+555+DT_INT. Good idea?


Closed Thread
Results 1 to 38 of 38

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Excellent!

    Now you really have "Got It".
    And described it well.

    Cheers,
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default Some final problems!

    I made my circuit on my breadboard. It works kind of OK (INT are longer than 1 sec intervals) with TICON=%00001111 the clock still keeps incrementing even when I take out the 32KHz crystal from RC0-RC1.

    The clock stops with
    TICON=%00001011, seems Interrupts stop happening with this setting. Can someone please put some light on why this could be happening?
    ___________________
    WHY things get boring when they work just fine?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Anyone? Should I start a new thread with this problem?
    ___________________
    WHY things get boring when they work just fine?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe??
    Do you have the Watchdog turned off?
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Maybe??
    Do you have the Watchdog turned off?
    Observations:
    Watchdog is OFF.I just tried it with 4MHz oscillator, everything works fine. Intervals are 1 sec as expected. I took out the 32kHz crystal while PIC was working, it suddenly increased the speed of counting seconds(I WAS EXPECTING IT TO STOP ENTERING IN ISR) i.e. interrupts started happening a little faster. I inserted the crystal back in, the speed became ideal i.e. 1 sec interrupts.
    Two questions now please:
    1) Why didn't the Interrupts Stopped when I took the crystal out?
    2) Why things get slow when I use 32768 Hz crystal as an oscillator for the PIC as well as the timer? 4MHz for PIC increases the current consumption to 2.5mA which is criminal when running on batteries.
    ___________________
    WHY things get boring when they work just fine?

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Are you saying that you have two 32768 crystals?
    The CPU will be running at 8192 hz (FOSC/4).

    You might as well run the timer off the main clock then, (saves the power used by the timer1 oscillator), and gives the same accuracy.
    T1CON = 1
    Reload TMR1H with $11100000, and definitely put it First in the handler.

    And change the LCD timing because PBP still thinks it's running at 4mhz.

    DEFINE LCD_COMMANDUS 17
    DEFINE LCD_DATAUS 1
    DT

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Are you saying that you have two 32768 crystals?
    The CPU will be running at 8192 hz (FOSC/4).

    You might as well run the timer off the main clock then, (saves the power used by the timer1 oscillator), and gives the same accuracy.
    T1CON = 1
    Reload TMR1H with $11100000, and definitely put it First in the handler.

    And change the LCD timing because PBP still thinks it's running at 4mhz.

    DEFINE LCD_COMMANDUS 17
    DEFINE LCD_DATAUS 1
    With recommended settings above i.e. TMR1H with %11100000 can someone please help me understand how many seconds or minutes the clock will be out after a month or an year because it gives me 1.00069 Hz frequency for Timer1
    ___________________
    WHY things get boring when they work just fine?

Members who have read this thread : 0

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