Use 16 bit maths routines, there are plenty of examples on the PICList of 16 bits maths. BUt for what you're doing, you don't need anywhere near 10 bits, and you're doing it correctly using it in 8 bit mode.
Hi I just wanted to add one more open question to this thread..
Id like to try and make one of those analog Audio meters with the 877a ADC...
hmm how to go about doing this..
I dont know which op-amp I should choose..
Id like either an electret mic or audio from say an IPOD to enter the opamp.. the output will go to a 4ohm speaker and also to an ADC on the 877a.. or 12F675 if i get them soon..
Then, just like in the program I made above a line of LEDs would portray the magnitude of the music or voice..
Im sure you know exactly what Im talking about so Ill leave it to suggestions now..
My main question is - do op-amps output a voltage range from vss right up to vdd? or are we talking only millivolts here?
You may well need to amplify it to make it large enough, also you need to rectify it, so it's DC - check for VU meter ciruits, which is what you're wanting to make.
General purpouse op amps don't usually operate to the rails.
If you're using a single supply source, the op amp must swing to the negative rail (ground, in that case).
The PIC12F675 have 5 output pins.
Seems like they're not enough for your project, are they?
General purpouse op amps don't usually operate to the rails.
If you're using a single supply source, the op amp must swing to the negative rail (ground, in that case).
The PIC12F675 have 5 output pins.
Seems like they're not enough for your project, are they?
When you say swing to ground do mean that as the signal increases on the non inverting input.. the voltage on the output (before the dc filtering cap) will drop?
If this is the case.. could I just find the voltage range of the output (from no sound to loudest sound) Then use that .. say .5 voltage range to divide the LED stages..
Would I connect the analog input directly to the op-amp output or after the filtering cap?
I guess I could multiplex the outputs or get a larger PIC.
You know there are 2 register ADRESH and ADRESL...ADRESH contains the high bits,ADRESL contains the low bits..For example ;
You may well need to amplify it to make it large enough, also you need to rectify it, so it's DC - check for VU meter ciruits, which is what you're wanting to make.