i doubt you really need to rectify the audio signal... well tell us what you exactly want to do with the audio signal.
i doubt you really need to rectify the audio signal... well tell us what you exactly want to do with the audio signal.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi,
I am rectifying the audio signal as part of my circuit to control the voltage and current the microcontroller will see, so as not to send it to much voltage or current. I forgot to post yesterday that the rectification happens after passing the audio signal through an opticalisolater. This is to seperate it from the stereo deck for safety.
What I want to do is simply have the microcontroller see is there is the signal present at an input pin and if so then it will turn on an output pin which will turn on my amp through a transistor circuit.
I think that the count command should be able to detect that the audio signal is there if/when it is. I was just hoping for some feedback that I am correct in this assumption.
This is a link to more information on what I am trying to do:
http://www.picbasic.co.uk/forum/showthread.php?t=2033
Thanks,
Michael
NAH!
To turn on an amplifier you just need an 50 cents Voltage comparator. Or if your really want to use a PIC, use the a/d or analog comparator input and do the according stuff when the voltage is over XYZ voltage.
What PIC do you plan to use??? PIC12F629,12F675,12F683 will be more than enough
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Using the ADCIN command allows for the use of an analog signal to the microcontroller. Looking at the example code on the webpage the whole PORTA is set as analog inputs. Is this because each I/O pin holds a bit? And if so which pin do you wire the input analog signal to? Also since I am measuring an analog signal that will range from 0-5V how many bits do I need to set the ADC to when all I want to do is measure if it is above 0V?
I plan to use the PIC12F629 since I plan to add more utility to this little piece at a later date.
Is there any other commands that I can use for an analog voltage comperator in PBP?
Thanks,
Michael
Last edited by Tear; - 25th July 2005 at 16:41.
There's no built-in command to read a comparator status. you need to read the register.
this something to start...
Code:@ __config _INTRC_OSC_NOCLKOUT & _MCLRE_OFF TRISIO = %11001111 ' GPIO.4, GPIO.5 as output CMCON = %00000010 ' COUT=1 when Vin+(GPIO.0) > Vin- (GPIO.1) ' comparator mode :comparator without output Clip var GPIO.4 Normal var GPIO.5 Speaker var byte start: speaker=CMCON.6 ' read from internal comparator Select case speaker case 0 clip=0 normal=1 case 1 clip=1 normal=0 pause 100 Clip=0 end select goto start
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi mister_e,
After looking through pages of information on rectifyingand using the PIC I am not sure it is the correct or easiest way to handle what I am trying to accomplish.
What I want to do is take the AC signal from the speaker wires and then use this to turn on an aftermarket amp. I was originally thinking that rectifying the circuit would do the trick, however I am not so sure anymore.
I am now thinking about using a comparator circuit like you have mentioned to do. However, I have two concerns with this though:
1. All the comparator circuits that I have looked at use one wire as input, whereas, it is two wires that come from the speaker. Do I simply ground the negative wire from the speaker and run the comparator with the positive wire?
2. Since the voltage on the speaker can be as low as 50 mV can an op-amp comparator circuit use this low of a reference voltage for comparing? (To keep the amp on when there is a 50 mV or higher signal present)
Thanks for the help,
Michael
Any simple single supply OpAmp would do the job.
Configure it for a gain of 50+ and supply it with 5V
an input signal of 50mV would result in an output of >=2.5V
(which is interpreted as HIGH in TTL)
But Steve is our Car Audio Expert,
so I'll leave it to him to find the final and perfect solution.
;-)
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks