PDA

View Full Version : Using the PIC12F675 for sampling / selecting?



Qacer
- 4th October 2006, 15:39
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!

sayzer
- 4th October 2006, 16:48
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?

Qacer
- 4th October 2006, 19:14
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!