Transistor Affecting Timings?


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Quote Originally Posted by RossWaddell View Post
    Charlie - I'm not trying to lock the two PICs in phase. Please see my earlier post where I tried to clear that up:
    And yet you are using a phase difference to decide the frequency is wrong? Anyway, I'm not sure how to say it any differently. If you want both circuits to be EXACTLY the same, then they need to be locked to each other. If they are not locked to each other, they will NEVER be exactly the same.This is because even hand picked components, and PICs created on the same die will have tiny differences.
    Match everything to 0.0000000000000000000000000000000001 percent, (feel free to add more 0's) and they will still eventually drift apart.

  2. #2
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Is your request then that you want to have the on-time and off-time always the same? Meaning, you want 1_second to be 1_second on Design#1 and also 1_second on Design#2.

    Then you must get your reference clock as accurate as you need it (which is what has been mentioned before). This has nothing to do with locking oscillators or anything like that. You want watch#1 and watch#2 to always read the same, correct?

    So your task is to determine what does "always read the same" means. If you need them to always be the same , with not tweaks whatsoever, forever and ever then you need to phase lock them - but this is not realistic for watches and doesn't look like it is for your application either. You then need to determine how much drift you can tolerate. Drift will happen, and you have to determine how to deal with it. Watch manufacturers (sorry I keep using watches, but it is an easy timekeeping tool) allow you to "tweak" (adjust) the time for that reason.

    You can use a crystal for your reference and pay attention to the drift requirements. The higher the number the more it will drift. You could also look at an RTC to serve you as the "time-keeper". You still may need a means to "adjust/tweak" if you want them to start right-on.

  3. #3
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Hi,

    If your goal is to have a LED flash at exactly timed intervals always and forever you could look into connecting your PIC to the AC lines in your house. Most countries have 50Hz (some has 60) and if you can detect the zero crossing you will have a 100 Hz reference signal that you can use for timing purposes.

    Then you can run the PIC on any kind of oscillator or x-tal since you only need to get the pic running on that clock source. For the LED flashing part you connect the 100Hz reference signal into a counter-input pin. If your counter is 8bit you then load it with with the value 155 and it will overflow 100 counts later to get the LED flash 1 sec on .. and 1 sec off. If you want it to be 0.1 sec on and 0.1 sec off you load 245 into the counter register.

    When you get the counter to overflow your interrupt service routine should reload the counter with the desired value (155 or 245) and toggle the LED. This way the LED is always toggled at really stable intervals and will not drift with time. If you have several similar circuits they will always keep in phase (flash at the same time) as long as they are started at the same time.

    The down side is: Main AC voltage is a potential killer and it will fry your circuit or you if you dont connect in a proper way. With a good circuit and enclosed in a plastic box it is usually ok but you need to understand the risks. With an OPTO coupler the risks are lower since most of your circuit will not be high voltage but if the only thing you want to do is flash a led then running the things from main AC should really be feasable. If you on the other hand want to connect a USB to your expensive PC or similar it is less of a great idea!

    The up side is that you get a really stable reference that will not drift with time or temperature and is indepedent of any clockspeed you use for running the PIC.

    The really good thing is that it is usually easy to find short circuits and bad designs, you only need to look for glowing parts and follow the smoke signals.

    Or you can get a off-the-shelf 220V to 5V AC power supply...
    Last edited by Jumper; - 21st April 2012 at 05:09.

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