Use a voltage divider to set the VREF. Darrel has info here.
http://www.pbpgroup.com/modules/wfse...p?articleid=25
Try reading your LM35 with a volt meter. Possible it is doing the skipping.
Use a voltage divider to set the VREF. Darrel has info here.
http://www.pbpgroup.com/modules/wfse...p?articleid=25
Try reading your LM35 with a volt meter. Possible it is doing the skipping.
Dave
Always wear safety glasses while programming.
No, not really, except from the fact that you only get two counts per degree from the ADC. You might wan't to try taking 10 or more samples and average them to filter the signal. Also it's possible that you're running into some kind of rounding error in the math due the low resolution but I haven't looked into it that much.BTW, do you have any clue about why it skips 28? Could it be something wrong with my math?
Regarding the external Vref I'd suggest you look at the datasheet for the particular PIC you're using regarding the ADC and its various Vref options.
Another option might be to just put an OPAMP after the sensor, boosting the signal by a factor of xx to better utilize the full range of the ADC.
A good current/temperature compensate Vref is always more than welcome... boosting the sensor output... mmmmpppppfffffff maybe not a good idea.
There's a load of great few bucks constant voltage source ICs here and there.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve,
I agree that a temp compensated Vref source is a better solution here but would you care to explain why you think it's not a good idea to boost the signal from the sensor?
Yes, the sensor noice will be amplified too but it shouldn't be that bad. Actually, amplifying the signal or lowering Vref shouldn't make any difference, except from non linearity of the amp and possible noice added BY the amp but I don't think that would be a problem in this case.
/Henrik.
I guess it depend of the accuracy you need. If you use the internal Vref, when the PSU voltage swing, your accuracy will swing with accordingly right?
Assuming the supply never ever swing... yeah you may boost the sensor output... carefully designed it has to work. Not something i would test on a breadboard... i'm kinda noise freak![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes absolutely, but if you have 20mV noice or swing on the supply rail with a sensor output of 10mV/° you have 2° worth of noice. If you boost the signal to 100mV/° the same noice on the supply rail is now "worth" 0.2° instead.I guess it depend of the accuracy you need. If you use the internal Vref, when the PSU voltage swing, your accuracy will swing with accordingly right?
PICante,
In a previous reply I sugested a Vref of 1.024V but after reading the 16F88 datasheet that may not have been a very good advice. Vref needs to be 2V minimum according to the datasheet so keep that in mind if you go for an external reference.
/Henrik.
Thanks guys!
Yes I like to try the external reference and I need one decimal accuracy with +- 0.5C overall. Maybe it will take a high stability voltage source to reach this.
Now I will try to figure out how to connect the Vref + & Vref- also how to set the bits in ANSEL and ADCON1 perhaps even the CVRCON? Not easy being a newbie! :-)
Bookmarks