Low frequency audio level detector using PIC ADC?


Results 1 to 40 of 69

Threaded View

  1. #14
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Low frequency audio RMS signal level detector using PIC ADC?

    Eeek, even a little bit of code like this....
    Code:
    main:
        toggle PortC.4   'pin 6
        'count1 = count1 +1 
        present_sample = ADRESH
        IF  present_sample < 128 then 
        present_sample = (127 - present_sample)
        else 
        present_sample = present_sample -128
        endif
    
        IF present_sample >= rolling_peak THEN
        rolling_peak = present_sample
        else
        if count1 =  50 and rolling_peak !=0 then   
        rolling_peak = rolling_peak -1       
        count1 = 0
        endif
        endif
        goto main
    is only toggling at 16khz - meaning that the main loop is only running at 30khz ...gulp (that's not leaving much room for anything else) bearing in mind I only have a 20khz sample rate going on...I wish the 16f1828 didn't have the ADC iissue about 8Mhz internal clock, becuase the obvious way of winning back por main loop time is to crank the internal clock up.
    Last edited by HankMcSpank; - 24th February 2011 at 21:53.

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