Hi folks,
I am attempting to modify existing hardware and software to implement an LM335AZ temperature sensor as well as interface a Maxbotix ultrasonic sensor. The uC is a Silicon Labs C8051F121 . The ADC0 is 12bit and has 8 analog channels available for input as well as an 9th channel which is a built in on chip temperature sensor. The existing code has a scale factor to convert the "count" values from the AtoD into mV values. I had to change this number quite a bit to get accurate values. The previous code did not need great accuracy. Also the analog inputs seem to top out (4095 counts) at 2.65V, even though the VREFA is 3.28V. The VREFA appears to be very noisy when sampling is occurring, almost 200mV Pk2Pk. We implemented a software average to help smooth out the output.
My questions:
1. Why am I unable to get the AtoD to read the full range of voltage? 2. What is the PCA gain and when/how should I use it? 3. Is the "noise" on the VREFA during sampling normal? 4. Should I continue to use the slowest sample clock possible? if my math is right its 1.03125MHz 5. Would it help to lower the SYSCLK from 66MHz is we find we can deal with a slower clock?
Thanks,
So I discovered the "zener" is in fact a band gap voltage reference: ZRC330F03TA made by Zetex. Would I still need filtering? the datsheet seems to suggest not.
The Temp sensor gives its output as 10mv/degree Kelvin. It will primarily be used out of the sun reading air temperature to compensate the Ultrasonic sensor. It is rated from -40C to +100C which would equate to 2.73V to 4.00V output. The actual air temperatures in the application will most likely be between 0-40C which would be 2.73V to 3.10V. That's obviously not a very wide range.
The Ultrasonic sensor has an output scaled (VCC/1024) per cm. It can range up to about 600cm. We will probably be measuring somewhere in the 100-300cm range with the actual range distance being very steady (+/- 2cm?) for most of the process time. The range is expected to increase about 100cm for a period of about 30 minutes once every 2-5 days. If the actual process range only varies by 100cm the corresponding output voltage will only vary by 0.322V. I think I can a 5V source for the Ultrasonic sensor which would get the voltage difference up to 0.488V
What is the accepted method for interfacing these type sensors to an AtoD?
Also the analog inputs seem to top out (4095 counts) at 2.65V, even though the VREFA is 3.28V. if you have the internal reference selected the max count is at 2.43V
Erik
I checked and the Internal Ref was being used. I have now changed that, but its still acting the same. REF0CN= 0x06. A/D channel 6 has 0.448V input. A sample from CH 6 = 0x290. If I try to calculate the reference voltage based on the counts and the input Voltage I get 2.786V. WTH?
publish your a/d code including the initialize on the SILabs forum, some there work with the f12x A/D almost daily. Remeber USE pre and /pre
www.cygnal.org/.../Ultimate.cgi