Need advice for creating nS time delay


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default Need advice for creating nS time delay

    At 4Mhz and at 20Mhz, how do we create a time delay for 200nS or 300nS?

    Clever ideas?
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Sayzer

    How are you ???

    let's see ...

    @ 20 Mhz ... a NOP is ... 1/ 5 Mhz = 200 ns ...

    so, just insert, in your PbP program :

    @ NOP ... and you get a 200 ns delay ...

    You can try to Boost a 16F PIC @ 30 Mhz ... ( I've read about 32 Mhz ...)


    With 18F series @ 40 Mhz , you will get 100 ns per NOP ... and it is a PbP DEFINE OSC ...

    so, 2 or 3 NOP's will do it !

    regards

    Alain

    PS : No PIC solution @ 4Mhz ( minimum instruction time is 1µs ... )

    But you can play with external logic gates ( if possible ...) and use their propagation time : time can easily fall to 10 nS ...
    Last edited by Acetronics2; - 10th December 2007 at 14:57.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Thanks Alain.

    I was playing with that calculation but I made it wrong.
    Actually, jumping from one line to another is also around 200nS ~ 300nS at 20Mhz.
    Just do A = B and get this delay.

    But I am unable to use 20Mhz, so I must find another way of getting at least 300nS at 4Mhz.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    a single instruction @4Mhz is 1uSec, this will be impossible to be faster for this frequency.
    Steve

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

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Sayzer

    Depends on the Pic you want to use ... but, if an internal oscillator could be used ( 16F88 i.e. ) ...

    you could think to change the osc. frequ by soft !!! ( 8Mhz maxi gives 500 ns ...)

    but depends if you could "boost" your osc frequ. for some instructions ...

    see 16F88 ( i.e.) datasheet $ 4.6.2 for further infos ...

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    or... eh eh, a 18F and enable/disable the internal PLL on the fly...
    Steve

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

  7. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics from France
    ...
    ...you can play with external logic gates ( if possible ...) and use their propagation time : time can easily fall to 10 nS ...
    Quote Originally Posted by mister_e from Canada and speaks French
    a single instruction @4Mhz is 1uSec, this will be impossible to be faster for this frequency.
    I was thinking to charge a 10pF capacitor and wait for its discharge.
    But before spending hours on its tests, should I keep thinking on this?
    Don't we have a cap on our input pins already? that is another issue.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 19:55
  4. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10
  5. Linx RF -> HSERIN time delay / time critical app...
    By batee in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th October 2004, 15:04

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