POT and RCTIME instructions


Closed Thread
Results 1 to 5 of 5
  1. #1

    Default POT and RCTIME instructions

    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
    .

  2. #2
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default LM335 (good low-cost temp sensor)

    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.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink Very good exercise ...

    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4


    Did you find this post helpful? Yes | No

    Default

    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 ?

    .

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. reading the value of a pot
    By studysession in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st February 2009, 09:45
  3. Pic Basic TouchScreen? How?
    By mindthomas in forum General
    Replies: 18
    Last Post: - 15th April 2008, 16:53
  4. I'm getting strange Results using POT or RCTIME on PortB (or GPIO Port)
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 20:01
  5. POT Command
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 5th May 2004, 16:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts