Zero cross detect - switching audio


Results 1 to 20 of 20

Threaded View

  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default Zero cross detect - switching audio

    So I'm wanting to have an audio switch that only actually switches at a zero crossing point (or very near to zero)...this will only involve audio upto about 1.5khz in frequency.

    My thinking here is to use a PIC's comparator ....ie toggling when zero points are 'crossed' (this will be a single supply circuit, 'zero' will actually be about 1/2 VCC), but how do I implement the associated code?

    At a high level, I reckon it'd be something along these lines...

    1. A switch is pressed
    2. wait until the comparator's output logic level is *not* what it was at the time of the switch being pressed (ie a zero cross has happened)
    3. raise the necessay control voltage to invoke the actual audio switch.

    .....now steps 1 & 3 I'm ok with, but how in code would I do step 2? Upon the switch being pressed, the comparator's output could either be high or low (it'd be random), I want to 'trap' quickly the opposite condition of what it is at the time of the switch being pressed.

    Ideas?
    Last edited by HankMcSpank; - 30th October 2011 at 12:37.

Members who have read this thread : 1

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