Delay with 50nS resolution...


Closed Thread
Results 1 to 17 of 17
  1. #1
    batee's Avatar
    batee Guest

    Default Delay with 50nS resolution...

    I'm working with 18 pin devices (16F88 is what I'm using now, but I'm open to whatever). I need a way to do timing down to about 50nS resolution. By my calculations, with a 20MHz clock, a clock cycle will be 50nS and an instruction cycle will be 200nS. Even if I went with a 40MHz proc, I wouldn't achieve my goal.

    Is there a way to do resolution with a (hopefully small/cheap) PIC?

    Thanks,

    Bryan A. Thompson
    [email protected]

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No, not with a PIC at this time.

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    50ns


    Whow !!!

    15 meters of lightspeed.... ;-)
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Your calculator is 10.3mm faster than mine....

  5. #5
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default Beer slows your reaction time!

    Beer slows your reaction time!

    In one nanosecond, light travels about 22.26 cm in beer.
    (Beer has a refractive index of 1.3466).

    In one nanosecond, light travels exactly 29.9792458 cm in a vacuum.
    (Refractive index of a vacuum is defined as having a value of 1.0).

    In one nanosecond, light travels about 29.89 cm in air.
    (Refractive index of air is 1.003).

    The exclusion of water from this theory was intentional.
    (RI 1.33).


    Luciano

  6. #6
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Of course you can! (And you were worried, right?)

    Courtesy Electronic Design mag:

    [Design Briefs]
    Measure Nanoseconds With A PIC Microcontroller

    Jeffrey L. Rothman, Richard Michta
    ED Online ID #5649
    September 1, 2003

    "Based on a PIC16F887 MCU, this circuit described measures pulse lengths from 2 to 950 ns with a 1-ns resolution."

    http://www.elecdesign.com/Articles/A...5649/5649.html

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    But it's not a real-time measurement, but one that is delayed by the response of the ADC spinning up, and the PICs associated instruction processing. The equivallent of "Can I use an Abacus to calculate the National Debt?". Sure you can if you wait long enough for an answer....

  8. #8
    batee's Avatar
    batee Guest


    Did you find this post helpful? Yes | No

    Default

    I think it's a shame that Ernie contributed a useful answer, the first I've seen around these parts, and gets mocked for it? By an admin?

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No, it was a valid answer. If you want to convert your Digital signal to Analogue, then wait, then have it converted back to Digital... then that's fine. But as at today, they've not made a PIC that can measure 50nS without a heap of external help.

    >the first I've seen around these parts

    Are you suggesting that this forum doesn't provide useful answers to it's members?

  10. #10
    batee's Avatar
    batee Guest


    Did you find this post helpful? Yes | No

    Default

    >the first I've seen around these parts

    Are you suggesting that this forum doesn't provide useful answers to it's members?[/QUOTE]


    Quite.

  11. #11
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    That's kinda insulting to everyone that's ever helped someone on this forum. From your posts I don't think you're qualified to make that kind of comment - even you got an answer by Ernie (thanks Ernie by the way, because batee obviously doesn't appreciate the answers folks receive here). Which begs another question, if this forum is so bad, then what are you doing here? After one and a half years since you became a member, how many times have you given up a jot of your time to help someone else?

  12. #12
    batee's Avatar
    batee Guest


    Did you find this post helpful? Yes | No

    Default

    While I have no Earthly idea how many posts I've made here, I can tell you exactly how many times I've given the unhelpful responses "RTM" or "Use Search Tool": 0 And for that I am most proud.

    The elitist attitude (reference your "not qualified" comment) and the unhelpful and in this case harmful and argumentative responses have indeed caused me to think twice before posting. Now it will be three times.

    Bryan

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Angry

    Hi, Bryan

    I could answer you your " problem" deals with pure assembler ... and this is not here the right place to post it.

    I will just tell you some ANs from µchip's site play with those time windows.

    My electronics knowledge ( LOL !!! ) tell me to use a HF oscillator, a gated counter ... and read the counter result.

    This sounds familiar to me as I read a while ago a datasheet from µchip where it was written " external gated TMR1 " ...

    as I am a kind guy ... I remember it was the 16F636 ... but may be this feature exists aboard other PICs.

    Counting my answers to your threads, I know one thing : a bit will be enough for that.

    Alain

    PS : "RTFM " means a little brain work from the author is Welcome. This Forum is not intended to give you " already kooked " solutions... But to try to learn you something ...

    The Chinese story of the fisherman ...
    or else:
    If the finger shows the moon, the idiot looks at the finger ...
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  14. #14
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Bryan,
    I find your responses to Melanie quite shortsighted. In the short time I have been a member of this forum, I have read countless posts from Melanie (and many others) containing great information and answers. However, as Alain pointed out, this forum is not about giving people cookie cutter answers (but that does happen). Nor is it a place to substitute for someones lack of effort. It is more about helping people work through the process of application and understanding.

    As you can deduce from my avatar, I am a Pilot. More accurately, for the last 10 years I have been an instructing pilot teaching others to fly. It is quite common for me to respond to a student's question with some version of RTFM, particularly when the question involves simple factual information which is easlily located (or when I preceive a lack of effort in learning the information). On the other hand, if a student has a question related to the application of what is in the manual, then I get excited. Now I can really do my job and help them work through the question/problem to get the answers. In the process, hopefully, they will learn more than just the answer to their question. That is exactly what I have seen on this forum, and why I consider it a key resource in my PIC education.

    Is the response "RTFM" used too often by some, or employed rudely and indiscriminatly? Perhaps. But is that a reason to discount all the insightful, and FREE, help that is provided by the active (and very cabable) members of this group? Certainly not.

    As for this thread, Melanie's second post was spot on, and not mocking at all. It did not reject the technique given, just pointed out that it
    had considerable weaknesses in application, and may not be appropriate for your intended application.

    As for me, thanks Melanie, Alain, Steve (mister_e), Darrel, ErnieM, and the many others I can't remember off the top of my head. I have learned a lot from your contributions.

    Steve
    Last edited by SteveB; - 22nd May 2006 at 21:11.

  15. #15
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well I'm sorry the forum doesn't meet your expectations. There's a couple of thousand members, some who contribute and some who don't, some who provide help, and some who receive help that would probably disagree with you that the forum isn't a useful source of information, education, inspiration and more than occasionally a kick up the butt where it's needed.

    Now Ernie provided a nice answer for you, and I simply commented that it's not strictly the PIC measuring in real-time. But since I'm not aware if you wanted real-time measurement or not it could well be the exact thing you're looking for. Great - another statisfied punter rides into the sunset.

    In the same way other folks have received answers, help, tips, schematics, code, set-up information and heaps of other goodies from this forum - you've obviously missed those posts. Some may even have been helped along the way. That information may not have been of use or interest to you - but it was to somebody somewhere. I stand by my comments - all of them!

  16. #16
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Talking

    Why must I think to "eng444" ?
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

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


    Did you find this post helpful? Yes | No

    Talking

    probably because some of your lights blinked
    Steve

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

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34
  4. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 19:55
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10

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