can someone help me with RCTIME


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Talking Its Alive!

    Quote Originally Posted by T.Jackson View Post
    As pointed out earlier, RCTIME is a digital function not analog. So you'll need to enable the port in digital mode. Your code gears the port up in analog mode. BS2 is an unpopular joke in my opinion.

    Alright Thankyou for your help i now got it to work. For other newbs who would prefer not make a fool of themselves. The working code is below.

    Thanks again. it now results in different things depending on the light. ^^

    Code:
    '---clock settings
            define OSC 8
            OSCCON = %1111110 ' sets internal osc to run at 8MHZ
    
    '----------turn analog on porta off, and use as digital input/output
            CMCON = 7 'Comparators off
            ANSEL = 0 'A/D off -- Port pins all digital
    '----------^^^^^^^^^^
    '----------the change is in this block of code
    
    '---** Constants
    
    rcpin var porta.3
    
    '---**variables
    
    rcreturn var byte
    
    '------**main program
    
    
    
    loop:  
    
    '----its rctime!
    pause 1000
    
    high rcpin
    pause 5 
    rctime rcpin,1,rcreturn
    low rcpin
    
    
    '----(end rctime) shows over folks ^^
    
    
    
    '----send serial feedback      
            serout2 porta.0, 16468, ["rc time was: ",dec rcreturn] 'call for data    
     '-----end serial feedback
    
    goto loop   'loop forever
    end

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


    Did you find this post helpful? Yes | No

    Default

    in case you're using a LDR (or high impedance analog source), i see some advantage of RCTime.. unless, i really don't. A simple transistor+few resistor + PIC adc, would be my solution if i need accuracy.

    Level detector? ---> PIC Comparator

    OR, PIC16F785 i've ordered a thousand of them yesterday, sOOOO much nice stuff on-board... built-in OP-AMP, 2 phase PWM + asynchronous feedback as a teaser...

    NEW TOY, NEW TOY
    Steve

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

Similar Threads

  1. PULSIN & RCTIME resolution calculation
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th January 2010, 15:34
  2. POT and RCTIME instructions
    By ruijc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th November 2007, 16:47
  3. RCtime timeout
    By chriroz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2007, 16:45
  4. RC - connection using RCTime produces strange results
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th February 2007, 17:16
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 15:45

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