Switch sensor vs. switch PIC pin


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Switch sensor vs. switch PIC pin

    So...This is correct ?
    Code:
    ...
    If portA.7= 1 then
    valoare=temperature
    semn=sign
    else
    valoare=temperature2
    semn=sign2
    Endif
    
    Gosub Selectie
    Gosub Display				' B for Common CATOD;without B for Common ANOD
    
    Goto Main
    
    '======================================================================================       
    Selectie :
    
    IF semn ="-" then					
        DIGIT_3="-"
        else
        DIGIT_3=" "
    ENDIF
     
    IF valoare DIG 2 = 0 THEN
        DIGIT_2 = " "
        ELSE
        DIGIT_2 = valoare dig 2
    ENDIF
    
        DIGIT_1 = valoare dig 1
        DIGIT_0 = valoare dig 0
    
    RETURN
    '======================================================================================       
    Display:					' For Common ANOD
    for i=0 to 4
        TEMP = DIGIT_3 : gosub segments
        COMMON_3 = 1 : PAUSE 1 : COMMON_3 = 0
    
         
        TEMP = DIGIT_2 : GOSUB segments
        COMMON_2 = 1 : PAUSE 1 : COMMON_2 = 0
       
        TEMP = DIGIT_1 : GOSUB segments
        COMMON_1 = 1 : DP = 0 : PAUSE 1 : COMMON_1 = 0 : DP = 1
      
        TEMP = DIGIT_0 : GOSUB segments
        COMMON_0 = 1 : PAUSE 1 : COMMON_0 = 0
    next i
    RETURN
    Thanks for support !Name:  ttt.jpg
Views: 2151
Size:  165.5 KB

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Switch sensor vs. switch PIC pin

    One of my DS18B20 it's about 4 meters from PIC. What is the smaller value of resistor used for this sensor ? Can I try with 1k ? Thanks !

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Switch sensor vs. switch PIC pin

    I have used 15m cable and pull up resistor 680 ohms. Resistor value depends greatly on the capacity of cable. And the capacity of the cable depends on the length.

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Switch sensor vs. switch PIC pin

    With 5 meters of cable from PIC to DS18B20, no need to decrease value of R (still 4k7). Thanks for support !

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Switch sensor vs. switch PIC pin

    ...but, in some cases, I decrease the value to 3k9...for the same lenght of cables !

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