PIC18F1220 RA4 using PULSIN ?

+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007

    Default PIC18F1220 RA4 using PULSIN ?

    Is there any good reason that I can't get the RA4 input to work with PULSIN? I am using a PIC18F1220 with a 20MHZ resonator. PULSIN works fine on any PORTB pin, but won't fly on RA4. RA4 works as a simple digital input; slow on/off transitions; but when looking at the output from a R/C receiver (digital proportional signals), it counts zero pulses. Like I said, all the hardware/software works fine on port B.

    I went through two days of hell trying to configure this thing, but apparently that is now working (CONFIG statement in the P18F1220.INC file, which gives warning errors). I have experience using this same code and logic on three other PICs. I am just trying to convert it over to this one.

    Any help would be appreciated. And yes I have searched and searched and read all of the config links, PIC data sheets, etc. Thanks in advance.

  2. #2
    sinoteq's Avatar
    sinoteq Guest

    Default Input buffer

    This problem have been up before in the forum. http://www.picbasic.co.uk/forum/showthread.php?t=11236 I bet the reason that RA4 does not work is because the Schmitt trigger buffer on that pin. The easy explanation is that your R/C receiver is a 3V device and you run your PIC on 5V. You can solve this in many different ways depending on what you feel like doing. The easiest is a pull up resistor on the RA4 input to boost the voltage. This will however feed a higher voltage into the R/C receiver and that might be a problem. Or you change the voltage to 3V.

    Where in the datasheet is this? Under DC Characteristics datasheet page 250 under 22.3

    By the way I think the datasheet for PORTA has a big misstake in it.
    Last edited by sinoteq; - 28th June 2009 at 03:44.

  3. #3
    Join Date
    Nov 2007


    Yes indeed! That is my problem. RA4 is a Schmitt trigger input and my Rx puts out 3V pulses with the PIC running at 5V. Thank you very much for saving me a bunch more time and headache.

    Unfortunately, a pull-up won't fix it, so time for a hardware design change.

  4. #4
    Join Date
    Sep 2005
    Campbell, CA


    When I have to do level shifting I find that a 74HCTxx gate does a good job. Power it from 5V.
    Charles Linquist

  5. #5
    sinoteq's Avatar
    sinoteq Guest


    What do you have on RA1? If it is empty make a solder bridge and you have your hardware change.

  6. #6
    Join Date
    Nov 2007


    Problem was resolved by reassigning I/O. Good tips though. Thanks to all. I learned something (always a good thing).

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Better understanding PULSIN
    By Wirecut in forum mel PIC BASIC
    Replies: 12
    Last Post: - 29th June 2008, 10:17
  3. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  4. Pulsin 16F819 problem
    By rekcahlaer in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th April 2007, 13:52
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 14:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts