Measuring audio phase shift through a circuit with a PIC


Results 1 to 40 of 50

Threaded View

  1. #27
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    As a relative PIC (& programming) n00b, even I realised that with every interrupt (& there'll be a whole heap of them generated here), some registers need to be stored away to be picked up again once the interrupt has finished. As the incoming audio frequency rises, the interrupt rate gets higher & higher eg at 2.5Khz, that's an interrupt every 400us...but it's worse than that, becuause there are two comparators, so it's actually an interrupt every 200us!

    So if having to store/restore registers every 200us, then it obviously makes sense to use the fastest interrupts - that's where I come unstuck ....I only presently know how to us DT's interrupts! (& I have no clue as to how fast they are vs ASM interrupts ...it's all a bit "Whoah...there goes scary stuff" at the moment!)

    Re your comment...

    I suggest you slim it down by using ASM inside the ISR and avoiding ReEnterPbp. You should see better results.

    bearing in mind the actualy routine is quite small....

    Comp1 Interrupt routine...
    store timer 1 count to a Variable "X"
    reset timer 1


    Comp2 Interrupt routine...
    store timer 1 count to a Variable "y"
    reset timer 1

    ..... would it be possible to at least get me started?

    Re the ISR - how would that be triggered?

    Re the ISR content - what ASM would that entail?

    I'm not expecting anyone to do this for me, but when you don't know where to even start....then any initial guidance is most welcome!

    Edit: Also, are there any suitable tools that can help me work out what's going on inside the PIC - I'm thinking along the lines of simulating in step time (vs real time) & seeing what's going on wrt registers.
    Last edited by HankMcSpank; - 29th September 2010 at 13:30.

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