Zero cross detect - switching audio


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Zero cross detect - switching audio

    Then I will have to agree with you. Now you could do it in reverse, on EVERY ZC, call ISR, Check for switch pressed or released, if it is, turn on thingy, of not leave.
    Or use the ZC as the timing for main.

    while not ZC :WEND
    switch pressed do stuff
    released do other stuff
    continue to twiddle bits, flash LED's, whatever
    goto main

    As long as main takes less then 333uS (for a 1.5K period) you will never miss a beat, and I don't think you can get any faster
    Last edited by cncmachineguy; - 31st October 2011 at 11:36.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Zero cross detect - switching audio

    Hi Bert,

    Apologies for the delay in coming back..... I don't really want to trigger an interrupt on every zero cross, as that will bog things down (there'll be heaps of them)...even though my main isn't doing much...it may get bigger & I'm still reeling from a similar thing with cap touch interrupts (basically to have a cap touch sensor feel 'zippy' you've got to generate a lot of interrupts ....I found to my cost how having a fairly modest interrupt rate quickly brought my main loop to its knees!)

    I'd rather not go with the zero cross/switch close detect in the main loop, because as mentioned, it's not doing much at the moment...but I'm a terrible one for lobbing things into my main & making it bloaty in short order ...at least an interrupt will get priority no matter I may/may not do in my main!

    Many thanks for everyone's input.

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