help plz


Closed Thread
Results 1 to 2 of 2

Thread: help plz

  1. #1
    CuE0079's Avatar
    CuE0079 Guest

    Default help plz

    im trying to make a program where u press a button and the pic measures how long u hold down the button in milliseconds. i use the PIC16F877A and my compiler is PicBasic. plz help me =)

  2. #2
    Join Date
    Jun 2004
    Posts
    43


    Did you find this post helpful? Yes | No

    Default hello !

    You may use RCTIME instruction.

    RCTIME Pin,State,Var

    RCTIME measures the time a Pin stays in a particular State. Pin may be a constant, 0 - 15, or a variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g. PORTA.0).
    The resolution of RCTIME is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the time in state is returned in 10us increments. If a 20MHz oscillator is used, the time in state will have a 2us resolution. Defining an OSC value has no effect on RCTIME. The resolution always changes with the actual oscillator speed. If the pin never changes state, 0 is returned.

    Example
    RCTIME PORTB.3,0,W0 ' W0 returns the time (in us), for how long the pin PortB.3 was in 0 state.

    If you need more assistance, do not hesitate to contact me.
    Good luck !

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 08:21
  2. Plz give me working of timers in PIC16F676
    By Vishal Raut in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 4th July 2007, 16:58
  3. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 10:21
  4. A basic interrupt question: plz help
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th May 2006, 09:03
  5. Need Help Plz. on chip Eeprom 16F84A
    By cesarman in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2006, 00:53

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