Using the PIC12F675 for sampling / selecting?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Qacer's Avatar
    Qacer Guest

    Question Using the PIC12F675 for sampling / selecting?

    Good day, all!

    I was wondering if someone can lead me to the right direction. I have created this block diagram to aide with my explanation:
    http://cdionson.googlepages.com/testing

    I would like to setup a priority sound detection system. I have three audio sources coming from, say, room 1, room 2, and room 3. Each audio source is prioritized based on their room numbers. Room 1 has 1st priority; room 2 has 2nd priority, and so on.

    For example, if a sound source is detected in both room 1 and room 3, then only the room 1 source is outputted since it has 1st priority. But if the audio source in room 1 goes away, then room 3 will be outputted because no other audio sources are present besides this room. If no sources are present, then the device is in sleep mode.

    I think I can do this with the PIC12F675 and the TDA7309 (datasheet link in the website mentioned above). I just don't know how to proceed especially when interfacing the audio sources with the PIC. The TDA7309 seems pretty simple to understand from the datasheet. It has 3-inputs and 1 outputs. You can select the input to be outputted via an I2C bus. I can just use the I2C routine from PICBasic to do this easily.

    For the audio-PIC interface, I was thinking of sampling the audio source signal via a simple high gain op amp configuration and connect that output to one of the PIC's input pins. Then, get the PIC to sample the pin at least 5 times in 1 millisecond to determine that the input is not a transient.

    I have a lot of questions about this. But the ones that come to mind are:

    1). Will I be able to use interrupts and the A/D converter for this? How?

    I had in mind to connect each of the audio source to a corresponding pin on the PIC. If a signal is suddenly present, then the PIC starts sampling the analog pin where the signal originated. If another higher priority signal shows up, then I stop processing the current signal and move on to sampling the higher priority signal. If the PIC determines that there is a constant signal source, then it tells the TDA7309 via the I2C bus to change the input channel selection.

    2). Is there more to do this than what I'm thinking? It seems like it's easily doable except for the fact that I haven't been that familiar with the PIC, yet.

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    If what I understood is correct, then the following case should be valid.

    Three rooms are sending you different levels of audio signals all at the same time, say Room1=2.6V, Room2=3.4V, Room3=1.5V, then you select Room1 to process through TDA7309 and divert the incoming audio signal to the loudspeaker.

    Am I right?
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Default

    Hi sayzer

    Yes, you are correct.

    I was thinking about the idea further. Maybe I can just feed part of each audio source to an op-amp with a really high gain. The output of this op-amp would then be connected to an available pin in the PIC. Then, I can just right a routine that will sample the pins; I'm stuck at this part, as well.

    Thanks!

Similar Threads

  1. Charger battery with pic12f675
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th July 2009, 19:15
  2. PIC12F675 problem with port 5
    By NL2TTL in forum mel PIC BASIC
    Replies: 2
    Last Post: - 5th June 2009, 01:23
  3. SERIN with a PIC12F675
    By ewandeur in forum Serial
    Replies: 4
    Last Post: - 30th July 2007, 15:04
  4. PIC12F675 trouble
    By russman613 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th February 2006, 18:40
  5. Erratic PIC12F675 behavior
    By russman613 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th February 2006, 14:46

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