PDA

View Full Version : POT and RCTIME instructions



ruijc
- 14th November 2007, 12:50
Hi all,

i've been studying the PBP manual and decided to test the POT and RCTIME instructions.

The idea is to use a temperature variable resistor and check it's readings with a lcd.

The code to read and display it should be simple and i'm guessing it's something like this :

using pot instruction
.
.
.
read1:
pause 500
pot porta.1,255,r1
lcdout $fe,1,r1
pause 1000
.
.
.
and using RCTIME
.
.
.
read2:
high porta.1
pause 500
low porta.1
pause 10
RCTIME porta.1,0,r1
lcdout $fe,1,r1
pause 1000
.
.
.
Since i'm working with a 16F84 pic i do not have any analog input like other pics.

My question:

Will any of these 2 methods work to read temperature ? Or is it better to change pics and get one with analog input ?

Thanks
.

T.Jackson
- 14th November 2007, 13:35
I don't think you could use rctime or pot to accurately measure temperature. You'll find that, in order to get some decent resolution; i.e. 0.5° steps - you'll need an ADC with 10 bit capability. Many senors, LM335 for example, induce 10mV changes p/ degree. So, if we have a 10 bit ADC we can detect changes as low as 5mV. (5 /1024) = 4.88mV actually.

Acetronics2
- 14th November 2007, 13:55
Hi, Trent

I think it's a very good exercise for our friend to discover how awful the POT function is ,
and with RCTime, the use of retrieving tables ( lookup + linearization ).

but we must keep in mind there's no issue to read temps with better accuracy than 1°C, if we do not use any calibration ...

Even a MS 5534 ( that is factory calibrated ! ) is given for a +/- .8 °C accuracy ...
The LM 335 is given for a CALIBRATED +/- .5 °C error ...

and do not talk abot the NTC's ( +/- 10 to 20% on nominal value @ 25°C )

Platinum std probes offer 1% ...

So, no need to look for high tech measurements for a ... 7 bits accuracy !!!

Alain

ruijc
- 14th November 2007, 15:30
Hi all,

thanks for the tips.

I have here a datasheet for the LM35.

The LM335 also looks very good.

I dont mind the 1ºC resolution, but i guess i will change my pic for one with ADC.

In your opinion what pic is more alike with the 16F84 but with ADC capability ?

.

mister_e
- 14th November 2007, 15:47
PIC16F88, PIC16F819 are nices and have internal OSC, which gives you 2 free i/o (or 3 if you don't use MLCR).

2-3 i/o for free, is a real nice bonus.

If you don't need anything timing critical (serial comm or else), no external OSC is also
1) time saver
2) cost saver
3) PCB space saver


come on... forget the stone-age and almost 10 years outdated 16F84 :D