understanding the pulse.


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by geckogrotto View Post
    I just got a scope recently and don't know everything about it but enough to play with it.

    The signal im reading is about 300 mv and its a square wave.
    Depending on the signal being sent the frequency changes.
    Looks like in one state its repeating every 14ms and the other state its repeating every 6.5ms.

    How do I read this information in on a pic in picbasic to see what its at?
    PulsIn GPIO.4, 1,Pulselen
    PulsIn GPIO.4, 0,Pulselen2
    Both return 0 do I need a pullup or down on the signal or to use another command?
    What version of PBP are you using?

    Are the PulselenX variables bytes or words? Probably should be words...

    Are both of your grounds (the PIC and the signal being checked) connected? Probably can't check another signal with one wire, gotta have a common ground.

    How fast is your OSC? The pulsin command might time-out before the pulse ends or the pulse width might be too long, both possibly because your OSC is too fast.

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


    Did you find this post helpful? Yes | No

    Default

    with a 300mV of amplitude... i really want to know how a digital i/o of a PIC could make the difference between the low level, and the high.

    You need to amplify the signal first or use a comparator interrupt to start/stop an internal timer, or feed it's output to a CCP module

    many possibilities...
    Steve

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

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    with a 300mV of amplitude...
    DOH! missed that! I suppose it would only work if that 300mV of change is right near the TTL low-high switch point.

  4. #4
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Thanks for the replies.
    I have no problem measureing a signal from another source thats at 270mV using 12f675 so I don't see why that would be the problem?

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


    Did you find this post helpful? Yes | No

    Default

    because you're lucky?

    look at the datasheet, the min voltage to be considered as HIGH level is written somewhere.
    Steve

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

  6. #6
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Are you talking about VIL and VIH?
    If so that means there have to be a 2V swing...

    Thats to tell if its high or low, im not sure this is the same thing.
    I have seen many other people using pics to decode the signal from a R/C receiver. The output of the receiver signal, the pulse width is no where near even half a volt.


    I have done this with a 270mV signal on over 50 chips so im either really lucky or something else.


    Again im new to all this but like I said I have never had any problems reading a pulse width off a rc receiver and thats at 270mV

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


    Did you find this post helpful? Yes | No

    Default

    any model or datasheet for your receiver? Is it possible that it's open-drain output type? what happen if you place a 1-10K pull-up resistor on it's output?

    And yup it's Vil and Vih. it may differ from one i/o to another depending if it's an TTL or shmitt trigger one.

    0.3 v seems realllllly low to me. If it works... maybe your scope miss some noise or maybe you have some better receiver / pic.

    still thinking you're lucky
    Last edited by mister_e; - 26th February 2007 at 01:30.
    Steve

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

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    -> If so that means there have to be a 2V swing...
    The difference between VIL and VIH is dependant upon the type of circuitry involved...generally speaking:
    CMOS: 0= <1/2 Vdd, 1= >1/2 Vdd
    TTL: 0= <.8v, 1= >.7Vdd

    -> the pulse width is no where near even half a volt.
    Pulse width is measured in time, not in quantity. If you are putting a meter on a line with a signal meant for a servo, what you are actually reading is the average DC voltage on that line. And 300mV seems about right consider that the signal isn't constant (50hz give or take) and is only around 1.5ms during those times.

    -> I have done this with a 270mV signal on over 50 chips so im either really lucky or something else.
    You probably haven't been measuring a 270mV signal. As stated in the paragraph above, you've probably been measuring a signal that swings from 0v to 5v, with an average DC value of 270mV.

    -> Again im new to all this but like I said I have never had any problems reading a pulse width off a rc receiver and thats at 270mV
    Again, R/C receivers don't output a signal that's around 270-300mV. It's definetely a signal that's repeating at a rate of 50hz, for about 1.5ms for every repitition. So if we do a bit of math on that...
    50hz = one signal every 20ms. A centered servo wants a signal of around 1.5ms, generally between 1-2ms. Therefore, over a second, the total amount of time, on average, with a pulse width of 1ms, this signal is reaching 5v is about 20ms.
    20ms out of 1000ms = (5v * 20ms) + (0v * 980ms) = .25V on average.

    Does that work for you?
    Last edited by skimask; - 26th February 2007 at 01:38.

Similar Threads

  1. Pulse Capture and byte building
    By boroko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st July 2009, 01:59
  2. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  3. Replies: 3
    Last Post: - 13th September 2008, 17:40
  4. Better understanding PULSIN
    By Wirecut in forum mel PIC BASIC
    Replies: 12
    Last Post: - 29th June 2008, 10:17
  5. Pulse Frequency Multiplication
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st August 2005, 10:39

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