Oscillators, counts, clock cycles, config settings ......& women


Results 1 to 24 of 24

Threaded View

  1. #23
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rsocor01 View Post
    Hmmm, that explains the phase shift part. But, how do you explain getting a reading of 3000 instead of 329 on Comp2 when you change the frequency at Comp1 to 100Hz?

    Robert
    I've not had time to revisit (only had a short while on this again last night), but here's what I was reckon was happening.

    I hadn't 'squared' the analogue sine wave signals going into the schmitt trigger (this will be my first port of call wrt solving this) - the schimtt will 'trip' at a predetermined level - and unless it is fed a square wave (with the fastest rising edge possible), then with a signal such as a sine wave, there'll inevitably there'll be some delay (or even 'lead') wrt the timing of the two respective signals coming out of the schmitt - and timing is obviously key if you're trying to measure phase difference!

    The shcmitt 'triggers' as a function of signal level & in this case (due to this area being somewhat new ground) I was feeding the two schmitts different signal amplitude levels, it was therefore triggering at different respective times (wrt to one another) & introducing a triggering 'time difference' - this is being picked up as phase delay by my PIC timers.

    At 1000Hz, the comp2 count was 329 (which is 32.9%%) at 100hz the comp2 count was 3000 (which is 30%) - the fact it wasn't a set percentage error suggests that this is related to schmitt incurred triggering 'time point' changing with input frequency.

    I need to 'square up' the analogue sine waves by feeding them through an identical circuits, prior to feeding them into the schmitt. I'm then in the realm of slew rates for the circuit that squares the sine waves up.....obviously I need the fastest rising edge possible to ensure that the schmitts don't add in their own lags betwen the two signals.

    Still...I learnt a whole heap ....& thank you (as ever) for those whoe chimed in....this truly is a great forum.

    I'll post results once I crack the all new improved phase measuring method (though the base 'floor' count of 29 when the same signal is "Y"'ed into both PIC comparators - as mentioned in my other thread - is troublesome). Whilst it would have been a bother for other to replicate what I was doing with all pass filters etc, there is something here that others could easily replicate on their own - feed an identical square wave (ie a PWM signal, clock ...whatever) into both PIC comparators use the comp1 & comp2 interrupts as above & see what base floor count you get....it's higher than I'd imagined it would be.
    Last edited by HankMcSpank; - 16th September 2010 at 09:48.

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