Issue with Array causing PauseUS to have 16uS overhead


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    The PIC is running at 20MHz. I have Define OSC 20 at the top of the code.
    I am not using Interrupts. Its a simple State Machine loop that runs correctly without the For-Next loop that clears the array.

    Without the For-Next loop the PauseUS has the correct time, but with it the PauseUS time is way off.

    I tried using NOPs, but was still getting a long delay. I think it must an interaction between the for-next loop that clears the array and the HSEROUT.

    I borrowed a DSO from work so I can do a bit of in depth investigation into what is happening and why.

    I will post the code later when I have it to hand.

    bill.

  2. #2


    Did you find this post helpful? Yes | No

    Default CLEAR should set your array to all zeros

    I think CLEAR will zero all your variables without you needing the For..Next lines you now have.

    HTH
    Brian

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


    Did you find this post helpful? Yes | No

    Post

    Hi, Bill

    1) why not try to place your delay comp. just BEFORE the loop ??? ( could help for debugging too ... )

    2) you can assign your variables banking ... see $ 7.3



    Now, 16µS @ 20 MHz is ~ 60-80 assembler lines ... that make a lot of bank switchings ... if it is bank switching.

    What's your processor ???

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

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. Sony LanC Program
    By l_gaminde in forum Code Examples
    Replies: 2
    Last Post: - 25th September 2009, 18:51
  3. RC5 decode on a 10F + Question
    By ultiblade in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th September 2008, 08:20
  4. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  5. reducing shiftout clock freq and PS2/PC interfacing ....
    By wireless magic in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th February 2008, 20:15

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