Simple asm delay ?


Results 1 to 23 of 23

Threaded View

  1. #18
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    @ delaycycles _ledred it gives a delay of 33uS no matter what the value of the leded var is ??
    That's because when you pass _ledred to the macro as the argument, it uses the 'address'
    of ledred, and not the actual value in RAM. Look at the address PBP places ledred at to see
    why that happens.

    You can't put a macro inside a loop with a variable as the argument. What you're looking to do just
    isn't possible (as far as I know) with a macro inside the loop, and calls to any .asm routine, timer, etc,
    just aren't going to give you from 1uS to 1000uS delay periods you need immediately after
    placing a value on GPIO.

    I would re-think the whole process if I'm stuck at 8MHz, or switch osc speed & PIC to support using
    the pauseus commands.
    Last edited by Bruce; - 13th November 2009 at 23:42. Reason: Macros
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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 : 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