monitor a guitar signal strength, then output a DC level?


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Most PICs only have ONE ADC which is multiplexed to a whole heap of pins. This means you have to select your Input, perform an ADC operation, select the next input etc etc...
    This is an old thread of mine, but I've just revisited it on account I wanted to be sure what I'd asked previously!

    Ok, I have my PIC program successful carrying out AtoD on one incoming (full wave rectified) guitar signal.

    Presently I'm hard coding the 'target DC' level for the PIC AGC circuit to strive for eg (let's say I've set a raw AtoD value of 550 as the optimum incoming DC level ...but the full wave rectified guitar signal is only measuring 400 - then the PIC just sends some pulses to a volume control to increase the signal)

    Now to try & save POTs/switches having to be mounted on the guitar, I'd like to design my own little board with a resident pot on it - I'd like use the DC level from this pot to set the AGC's target incoming DC level for the circuit to strive for - the thing is my PIC 16F690 is already using one channel of AtoD to sample the incoming rectified guitar signal. From Melanies post above it seems that I'll need to switch the AtoD converter to another input pin

    How do I switch the AtoD pin - is that done with the ADCON0 setting? (& presumably I have to switch back & forwards between the two pins involed - each time changing the pin that the AtoD converter is connected to)

    Let's say my guitar signal is AtoD'ed on AN1 ...if I then want to use AN2 in my circuitry, does this mean that everytime I want to establish the DC level on the pot, I need to invoke a ADCON0 command to change the CHS2,CHS1 and CHS0 bits (bits 3,4 & 5 of the ADCON register?) Forgive the naive line of questiong - I'm far away from even being considered an entry level programmer - this stuff doesn't come easy to me!)

    Someone asked a bit further up this thread, to post a demo of the thing I'm pottering on with , well here's a link to a short video I made (albeit this video was when I was using analogue for the AGC aspect - which was not flexible enough in the end, hence returning to the scary world that is digital!)



  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Ok - I manged to kludge my way through it & get two AtoD channels working - but man, what a struggle ...you'd think they'd gone purposely out of their way to getting something as simple as AtoD setup (it's akin to having to read the service manual on the hubble space telescope!)

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Have you considered using the NE/SA 572 chip? I think to propr do such a job with controller you need a fast one like dsPIC or better a DSP processor.

    PIC'c do not have many resources for analog processing.

    Ioannis

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Have you considered using the NE/SA 572 chip? I think to propr do such a job with controller you need a fast one like dsPIC or better a DSP processor.

    PIC'c do not have many resources for analog processing.

    Ioannis
    That's a nice little chip, but alas the minimum VCC is 6V. (I'm tied to 5V)

    As it goes, in my config, I'm not placing that much in the way of demands on the PIC - it's simply sampling a rectifed/smooth guitar signal to get a handle on the signal strength. The PIC then either pulses up/down a digital pot accordingly - as simple as simple can be.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    If you use the proposed chip, then why still use 5V as power? Do you have need for a controller?

    Anyway, is it working now or you have other problem with the PIC?

    Ioannis

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    I'm tied to using 5V as I will be placing this board inside a guiutar that already has 5V inside it - I want to tap into that supply for my circuit.

    The circuit itself works, but I need to refine the Automatic Gain Control 'decisions' made by the PIC - & I'm still very much finding my feet wrt PIC Programming!

    For example I need to modify the the code to make a decision something along these lines...

    "If the present incoming AtoD sample if 40% bigger than the last AtoD sample then do nothing - just keep looping until the sample falls in level to equal a user determined level"

    (In the situation above, it means a new note on the guitar has just been plucked - however, at the minute, my circuit's Automatic gain control sees the incoming larger signal of the plucked string & cranks the gain down - but it then struggles to get the gain up in time after the initial high pluck signal strength has dropped out!)
    Last edited by HankMcSpank; - 30th October 2009 at 10:01.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    How about :

    Code:
    if signal>(0.6*prev_signal) then gosub attenuation
    Ioannis

Similar Threads

  1. small dc signal amplifier schematic need
    By phoenix_1 in forum Schematics
    Replies: 9
    Last Post: - 8th May 2009, 03:32
  2. Output current to a DC motor
    By bigbanner in forum General
    Replies: 1
    Last Post: - 6th April 2009, 07:29
  3. Unwanted output signal jitter
    By LinkMTech in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th January 2008, 02:31
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46

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