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
    Here's a video which shows how the two LEDs start off in sync (first 10s) and then gradually go out of sync
    It should be easy to prove to yourself it has nothing to do with the transistor - make the second circuit exactly like the first and observe how EXACTLY the same loss of sync happens.
    Having 2 unrelated free running oscillators stay in sync is not a reasonable expectation. (Oscillators 101)

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    It can be EASY to check the OUT OF SYNC problem by having ONLY 1 of the PIC's with a resonator running and use the OSC output from the one running the resonator connected to the OSC input of one with out a resonator. There by both PIC's will be running at the EXACT same frequency. Unless there is some difference in the code running on each PIC they should not fall out of sync.
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Hi,

    We also could raise scheme 1 ( unbuffered led ) will produce little heat inside the pic chip... then somewhat disturbing the oscillator ...

    .6v loss ( typ. ) @ 10 mA = 6mW ... @135°C / Watt = 1°C !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    RossWaddell,

    Why don't you use a 16F or 18F PIC series with an internal oscillator. Also, you can drive the 4 LEDs from 4 different ports without transistors. Or with Vcc=5V you can even drive two LEDs per port without a resistor (the PIC has an internal resistance).

    You can also try the same timming experiment that you did above with a 16F or 18F PIC, using the internal oscillator, to see what happens.

    Robert
    Last edited by rsocor01; - 19th April 2012 at 15:01.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    I also thought last night about removing the transistor on the 2nd PIC to test the timings and lo and behold - it also goes out-of-sync after a minute or so. I would agree that the most likely explanation lies with the tolerance of the resonators.

    To clear up a few misconceptions: I'm not trying to link the two PICS/LEDs. I had used the first schematic to test out the timings (I videotaped the blinking to match the frame rates to my source movie) and was disappointed to see it different when hooked up to the transistor (which turns out to be not relevant). I hadn't accounted for the tolerance of the resonator so either I need to use these specific components when finalizing the circuit or provide a way to tweak the timings during runtime (reading a pot, for example).

    Some final questions (I hope):

    * Is there a better resonator/oscillator I should use which would be more accurate (higher tolerances)? I was using 20Mhz because I thought the 12f629's built-in 4Mhz wasn't sufficiently accurate. Henrik - you mention this in your post so if you know an oscillator component that would be better please let me know.

    * Gusse - I've thought about using the clock output of one PIC to be the input on other PICs but it never seems to work for me. Are saying I can dispense with the 20Mzh external resonator/oscillator, remove the define and just connect GP4 to CLKIN on the other PIC?

  6. #6
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Quote Originally Posted by RossWaddell View Post
    I've thought about using the clock output of one PIC to be the input on other PICs but it never seems to work for me. Are saying I can dispense with the 20Mzh external resonator/oscillator, remove the define and just connect GP4 to CLKIN on the other PIC?
    What is your realistic accuracy requirement and where does it come from?

    If LED blinking was just a trial circuit for your end application, then OK. But if your application will be LED blinking device, then I don't get why internal 4MHz OSC with +-1% tolearance would not be enough. +/-1% means max. 5ns/cycle deviation between two corner oscillators (every 50s, 1s time difference). OK, it is quite much, but everything is relative...

    20MHz +/-50ppm means +/-1kHz deviation => an error of 26 minutes per year. Is this OK?
    With VCTCXO you can have less than +/-1ppm stability.

    If you want to use GP4 as an output, then you need to use internal 4MHz OSC, GP4 is multiplexed to OSC2 so XTAL cannot be used.
    With external clock source you can use PIC in EC mode.
    Last edited by Gusse; - 20th April 2012 at 08:22.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Charlie - I'm not trying to lock the two PICs in phase. Please see my earlier post where I tried to clear that up:

    To clear up a few misconceptions: I'm not trying to link the two PICS/LEDs. I had used the first schematic to test out the timings (I videotaped the blinking to match the frame rates to my source movie) and was disappointed to see it different when hooked up to the transistor (which turns out to be not relevant). I hadn't accounted for the tolerance of the resonator so either I need to use these specific components when finalizing the circuit or provide a way to tweak the timings during runtime (reading a pot, for example).

  8. #8
    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.

  9. #9


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Robert - the 12f629 has an internal 4 Mhz oscillator calibrated to 1%. I'd prefer something more accurate hence the external oscillator.

  10. #10


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Maybe a 20 Mhz crystal oscillator with capacitors is the way to go?

    "Crystals provide accurate timing to within 50 parts per million (PPM)"

    If that's true, then that's better than a resonator with 0.5 % accuracy.

  11. #11
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    Quote Originally Posted by RossWaddell View Post
    Maybe a 20 Mhz crystal oscillator with capacitors is the way to go?

    "Crystals provide accurate timing to within 50 parts per million (PPM)"

    If that's true, then that's better than a resonator with 0.5 % accuracy.
    Actually it is a 0.005% accuracy!!!!! Yes, the external oscillator might be the way to go.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  12. #12
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Transistor Affecting Timings?

    If you are dealing with video and not HD video then you are dealing 29.94 frames per second, a rather low frequency. Two different crystals will never sync as each is producing a sine wave or modified square wave and the start of the pulse (leading edge) will change. You might be better off using the CCP1 and CCP2 outputs and the "HPWM" command if you are working with two different frequencies. Also, the LED in your drawing should be from the emmitter to ground, You can leave R-1 from +5v to the collector. The reasoning is that in an NPN transistor there is current flow from the base to the emmitter (notice which way the arrow points). Hope this helps. Ed

  13. #13
    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
    Maybe a 20 Mhz crystal oscillator with capacitors is the way to go?

    "Crystals provide accurate timing to within 50 parts per million (PPM)"

    If that's true, then that's better than a resonator with 0.5 % accuracy.
    To repeat my earlier post, you will NEVER get them to stay locked in phase using 2 different oscillators - this really is oscillators 101. You are simply wasting your time trying, it is not fundamentally possible. One needs a reference from the other, it's just that simple. There are many ways to do this, including the examples already given.

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