PULSIN ON PORTF and PORTG ON 16F1947


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: PULSIN ON PORTF and PORTG ON 16F1947

    why not make your own pulsin it maynot be perfect but it will give reliable results

    set a 16 bit timer to overflow just past 3ms with appropriate pre and post scalers
    then
    my_pulsin:
    txcon = 0 ;stop the timer x
    tmrx.hi =0 ; reset timerx to 0
    tmrx.low =0
    while portf.x ; waiting for a low pulse
    txcon = ? ; the appropriate setting
    while !portf.x ; timing the low period
    txcon = 0 ;stop the timer x
    pulsletime.highbyte = tmrx.highbyte
    pulsletime.lowbyte = tmrx.lowbyte
    return


    I just notice your clock is 32mhz so timer1 will give you a 8ms max time with a 1:1 prescale and a 1.25uS resolution , I'm no sure what the min measurable time woud be but it will be consistant
    Last edited by richard; - 7th December 2013 at 02:20.

Similar Threads

  1. Replies: 10
    Last Post: - 26th November 2013, 08:38
  2. 18F8722 PortF Problem
    By shawn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th May 2011, 02:30
  3. 18f4550 USB and pulsin or pulsin alternative
    By vacpress in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th January 2009, 13:14
  4. Strange behavior - PORTG.2, 18F8720
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th January 2009, 23:30
  5. Pulsin
    By droptail in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th March 2006, 17:03

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