Power line timebase


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1

    Default Power line timebase

    I thought I'd redo a pic stopwatch that I did and rather than crystal control, use the AC line frequency as a timebase. (It's not a portable stopwatch).

    I really would like some hints on what I can do.

    I keep thinking no matter what, I'm going to have to have an external chip to convert the 60hz to 1 hz (or whatever)....but do I?

    I really don't have much experience with what a PIC can do "in the background"...but it seems limited to it's own peripheral hardware (tmrs, usart, etc).

    Are there any creative ways that I could monitor the line frequency and yet still have the continuous program running doing all the math and led display functions etc. ?

    Like I say, I suppose a counter or 2 as an external timebase is probably where I will end up? (There was a chip CD4566 that was a 60hz to 1 hz timebase but no longer available).

    Any ideas?

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


    Did you find this post helpful? Yes | No

    Default

    Yes it's possible and you can skip the additional external hardware. Just feed the 60Hz to a interruptible pin, a Timer CLK input or whatever else will do the trick

    What do you want to do exactly?
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Ok, sure...I've never used the internal timer before and yes the clock input would be the way to go...it would always increment that internal timer and then
    I could look for a 1 second flag.

    The T0CK input, right?

    Right in front of me, yet like I said, have never used the timers before....forgot about that input pin.

    I suppose you choose that pin in a register and the default is that it's incremented by the PIC crystal.

    Great ! Thanks.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Just a matter of getting the 60hz sine wave squared up?

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


    Did you find this post helpful? Yes | No

    Default

    you don't need to bother to much about that, use a simple resistor in serie (as current limiting) and look what's happen to the wave? Yeah, the PIC internal diode clamp it, most of the time, it's fair enough.

    I have to go, but i may do something to help you to start. Which PIC do you plan to use?
    Steve

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

  6. #6


    Did you find this post helpful? Yes | No

    Default

    I have some antique 16c65B's.

    Thanks Mr E, you put me on the right path...it'll be fun to learn about the timer modules and interrupts.

    Just though I'd take the 60hz off the secondary of my 6 volt transformer.

    My crystal based worked fine but I don't like the temperature variations.

Similar Threads

  1. Replies: 3
    Last Post: - 29th April 2009, 00:45
  2. Using input from Switch to control a loop
    By MrRoboto in forum mel PIC BASIC
    Replies: 9
    Last Post: - 2nd February 2009, 05:02
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. Power Line loging.
    By jcon777 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th July 2004, 15:08

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