real time clock


Closed Thread
Results 1 to 40 of 45

Thread: real time clock

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Question 32.768 Khz

    Is it possible to use a 32.768 Khz crystal with picbasic pro ?
    I know the minimum given in manual is 4 Mhz, but is there anyway to use a 32.768 Khz to reduce power consumption ? ? ?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by shahidali55 View Post
    Is it possible to use a 32.768 Khz crystal with picbasic pro ?
    I know the minimum given in manual is 4 Mhz, but is there anyway to use a 32.768 Khz to reduce power consumption ? ? ?
    If you run a PIC at 32.768khz, with a PBP program that's compiled to run at 4Mhz, the only thing that'll happen is it'll run 122 times slower (i.e. pause 1 @ 4Mhz = pause 122 @ 32.768khz).

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by shahidali55 View Post
    I know the minimum given in manual is 4 Mhz
    Not that helps here, but 3 MHz also is an option as is given in the manual

    Code:
    Define OSC 3
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  4. #4
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    I've already tried that skimask. . .
    It really puts all the PBP routines off . . .
    LCDOUT takes like 3 seconds to print 16 digits . .

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by shahidali55 View Post
    It really puts all the PBP routines off . . .
    LCDOUT takes like 3 seconds to print 16 digits . .
    Which is exactly what I'd expect...unless you write the code in assembly, PBP will time everything like it was running 4Mhz. Maybe try 'lcd_commandus' and lcd_dataus' both set to 1 and see if it works like that at 32khz.

    Which PIC are you using this time?
    There is a clock switching feature in most newer PICs these days, can switch between the main (4Mhz or whatever) and the internal 32/37/40khz (depends on the datasheet you're looking at) 'backup' oscillator if configured correctly. I use it all the time to save power.

  6. #6
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    I'm using a 16F84A so there is no question of internal oscillator.
    I tried several other things besides LCDOUT. Even FOR and WHILE statements take a lot o ftime to execute . . .
    I used a external 32.768Khz oscillator.
    Just to verify that the F84 was running at 32.768Khz, i tried a clock code on it and it does keep accurate time . . . down to a second a day.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by shahidali55 View Post
    I'm using a 16F84A so there is no question of internal oscillator. I tried several other things besides LCDOUT. Even FOR and WHILE statements take a lot o ftime to execute . . . I used a external 32.768Khz oscillator. Just to verify that the F84 was running at 32.768Khz, i tried a clock code on it and it does keep accurate time . . . down to a second a day.
    If you're running 32.768khz, everything is going to take a lot longer to execute.
    The clock is 32.768khz, but the PIC is only executing instructions at 8.192khz (Fosc/4), and if you're code has a lot of call's, gosub's, returns, anything that takes the code to 'somewhere else', it'll run half that fast again (4.096khz, Fosc/4 + one extra instruction for each 'somewhere else').

    So, what are you asking? What's the point?
    Last edited by skimask; - 31st May 2007 at 16:12.

  8. #8
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    I think i'll stick to 4Mhz for now . . .

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 : 4

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