Delay question


Closed Thread
Results 1 to 22 of 22

Thread: Delay question

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default

    Therian,
    Yes, that is correct. With a 4Mhz X-tal one intruction cylce is 1uS and since the NOP command takes one cycle to execute the delay will be 1uS.

    /Henrik Olsson.

  2. #2
    Join Date
    Jan 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    just curious, is 250nS enough to generate radio frequency directly from pic without any rf modules, it sound like cheap radio link

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default

    Therian,
    Well, let's see:
    Code:
    Start:
      PortB.1 = 1     'Set pin high        
    @ NOP             'Wait....Two NOP's are neede if we want 50% dutycycle
    @ NOP             'since the GOTO takes two instruction cylcles.
      PortB.1 = 0     'Set pin low
    Goto Start        'Do it again. The GOTO takes the same time as two NOP's
    This, I think, will generate a pulsetrain with 50% duty cycle. The frequency would be ~833kHz. Not much of a radio frequency.... besides that, you can't do anything else in the code without slowing it down more...much more.

    /Henrik Olsson.

  4. #4
    Join Date
    Jan 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    maybe overclocking might work ?

  5. #5
    Join Date
    Jan 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    wait 833kHz is in range of medium AM broadcast 300-3000kHz and 30-300kHz is longwave AM broadcast but as i know 3-30kHz is enough for submarine communication. so what wrong with using low frequency, huge antenna ?
    Last edited by therian; - 5th March 2007 at 13:10.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default

    Therian,
    First all, I've stated 250nS in my previos posts. That is of course wrong and should be 200nS. NOT 250.

    With that being said you could go to a PIC capable of 40MHz, then a single cycle instruction (like NOP) is executed in 100nS instead of 200.

    But then again if you use software to generate the carrier frequency you'd be hard pressed to have any instruction cycles left to be able modulate it. I really believe you should look at a dedicated TX/RX chipset or module.

    Anyway sorry for the confusion. One instruction cylcle is 200nS at 20Mhz, nothing else.

    /Henrik Olsson.

  7. #7
    Join Date
    Jan 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    im really thankful for you reply.
    I know about cheap and good modules out there, but dont anyone try to make some from scratch, it easy to fing FM bugs circuits in google but searching for rf module give really few results

Similar Threads

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

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