Zero cross detect - switching audio


Results 1 to 20 of 20

Threaded View

  1. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Zero cross detect - switching audio

    Hi Jerson,

    I anticipate the actual switch involved being pressed very rapidly (think 'teen on an arcade button'!) ...I'd be worried about the overhead of getting in/out of any interrupt *after* trapping the switch being pressed, so I was thinking of an IOC interrupt for capturing the switch being pressed & then somehow trapping the next comparator toggle in the IOC interrupt routine.

    At the minute the best I can come up with, is something along these (high level) lines...

    Code:
    Sw_Interrupt: 'IOC interrupt handler
    '
    stored_comparator_level = comparator_output_level   ' store the present comparator logic level nb: I've not delved to get the actual registers involved, this is high level stuff!
    '
    while comparator_output_level = stored_comparator_level  'keep looping until there's a mismatch
    wend   
    '
    'ok, to drop out of above wend and get to this point, then there must be a mismatch (a zero cross - comparator toggle) so let's continue  
    '                                                                   
    PortA.1 = 1 ' switch PortA.1 high immediately after comparator has toggled (ie the control voltage to the audio switch)
    ...blah blah
    Not even sure if you can use a while/wend like that?

    PS Dave - you've lost me...this has nothing to do with AC mains?! (I'm talking low level audio zero cross detect)
    Last edited by HankMcSpank; - 30th October 2011 at 15:44.

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