RC - connection using RCTime produces strange results


Closed Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102

    Default RC - connection using RCTime produces strange results

    Dear readers,
    I have attached a RC connection to a Microchip's pin.
    Pin ---- 0 to 40 kOhms ---- 100 nF ---- GND

    1. Make Pin high
    2. Let wait for 20 ms
    3. Set pin to high-impedance
    4. I let wait, till pin Low becomes low - counting while doing so

    Depending on R value it is faster/lasts longer to make pin Low.
    I make the value of R be constant and do several measurements. The result is visualized for me.

    What can I infer from these values ?

    Code:
    W1:
    	ADCWert = 0                   ;I           
        TRISA.3 = 0
        PORTA.3 = 1
        Pause 3
        
        ;PORTA.3 = 0                   ;II
        TRISA.3 = 1
        WHILE PORTA.3 = 1
            ADCWert = ADCWert + 1
        WEND      
        
        TRISA.3 = 0                   ;III
        PORTA.3 = 0
        Pause 18 
    
    W2:
        ADCWert = 0
        Low PORTA.3 ; Discharge cap to start
        Pause 10 ; Discharge for 10ms
        RCTIME PORTA.3,0,ADCWert ; Read potentiometer on Pin3
    	
    W3: 
    	ADCWert = 0                   ;I
        TRISA.3 = 0
        PORTA.3 = 1
        Pause 3
        
        ;PORTA.3 = 0                   ;II
        TRISA.3 = 1
        WHILE PORTA.3 = 1
            ADCWert = ADCWert + 1
            TRISA.3 = 0
            PORTA.3 = 0
            TRISA.3 = 1
        WEND      
        
        TRISA.3 = 0                   ;III
        PORTA.3 = 0
        Pause 18    
     W4:
    	ADCWert = 0                   ;I
        TRISA.3 = 0
        PORTA.3 = 1
        Pause 3
        
        ;PORTA.3 = 0                   ;II
        TRISA.3 = 1
        RCTIME PORTA.3,1,ADCWert    
        
        TRISA.3 = 0                   ;III
        PORTA.3 = 0
        Pause 18
    Attached Images Attached Images   
    Last edited by selbstdual; - 8th February 2007 at 17:20.

Similar Threads

  1. Searches
    By bearpawz in forum Forum Requests
    Replies: 11
    Last Post: - 7th November 2005, 19:47
  2. Strange Results in Math
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 31st August 2005, 08:09
  3. Help! - Very strange results with ShiftIn/ShiftOut
    By khufumen in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd February 2005, 23:21
  4. First test program, but strange results
    By bartman in forum General
    Replies: 12
    Last Post: - 19th November 2004, 04:14
  5. 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, 21:01

Members who have read this thread : 1

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