> What I need to do is program a PIC (I have a few > 12F675's) to monitor > the audio stream and the "standby" LED signal (0-5v > square wave, 50% > Duty Cycle. It flashes when in standby mode) and > have the PIC toggle > the standby button (on-off momentary) when these > conditions are > active: 1) You can use a comparator for this. Maybe the PIC you own has the feature? > > - If there is no music and the standby LED is off > then it should toggle it on. > > - When there is music and the standby LED is on, it > again should toggle it. > > - "Do nothing" situations are Music on, LED off and > Music off, LED on. > > - In between songs if the controller is left out of > standby mode then > the lights will take a random pattern. > > - After all the songs are done the lights will also > stay on in a > random number (it seems to latch on the last ones > that are lit and > stays there). 2) All of this can be done using comparator with code. > > There are 12 spot lights. Hence the need for > toggling the button. > > I was going to use the ADC of the 12F675 to detect > the audio but from > the documentation, it says that won't work. I plan > to use the > comparator (CMCON - CM0, CM1) to test for the LED > status and the > comparator interrupt flag (CMIF) to indicate when > the LED is on. Once > read I can reset the bit in the program. I could use > some help in the > audio detection area. The audio signal is coming > from the audio output > of a standard home DVD player. I haven't scoped it > but I assume it's > in the area of a volt or so. > 3) Detect the signal? Or detect the voltage level? If just the voltage level use the comparator. But if you need to detect freq. then you can use dsPIC which has a higher sampling rate. But if you need to detect a few range of freq. you can use capacitors. John PS: Looks like you need a comparator more. Suggest you read from Analog Device which has some good material. Don't rely too much on the MCU for this work step back and read more on voltage amplifiers and capacitors. You will be amazed what you will find :) ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist