Strange IT behaviour


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    nevermind...

    Robert
    Last edited by Demon; - 8th February 2012 at 17:04.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    There's not enough code to figure out your problem. But if I had to guess you need to
    increment your address counter by two and not one. This is a difference between the 18F's
    and the 16F's. The data sheet explains how the program memory is addressed

    Code:
    For TAB_Adr = TABWF to $7F step 2
    READCODE TAB_Adr, X
    YOUR GOSUBS
    Next TAB_Adr

  3. #3
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    Hi mark_s,

    The data, as read by Readcode are organized in bytes, not in words and declared by DB instructions .
    For example, this is a line from the data tables :
    DB 67, 67, 82, 67, 66, 67, 65, 67, 66, 81, 65, 66, 64, 63, 62, 61

    So the increment must be 1 , not 2.

    Sorry, but the example you give is a simple polling program, not synchronized by any interrupt.
    This example does not address the issue I raised : How to handle the fact that ReadCode (or any Basic instruction) is restarted again and again by high rate interrupts instead of terminating ?

    MikeBZH

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    Mike,

    Like I suggested to someone else, maybe if you made a small test version of your program and keep only the absolute minimum code to run the loop above.

    You can populate the table with test data and go on from there.

    It would make posting the code so much easier to you, as well as for others to spot potential problems in your logic.

    Basic and very simple, but it does not work !
    That's the sort of stuff we see in signatures here.

    Robert

    Not as dumb as yesterday!

  5. #5
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    Demon,

    Thank you for your advice.

    Of course I did what you suggest : write a very small program and test it and that's how I found that the problem was coming from ReadCode and its execution time.
    After 40 years spent in the lab I know the methodology, thanks !

    I am just asking for a precise advice/recommandation to the issue I raised. In relation with ReadCode and the interrupts. Nothing else

    MikeBZH

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


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    May I suggest that you take a look at this link:
    http://www.picbasic.co.uk/forum/showthread.php?t=3891
    Last edited by sayzer; - 9th February 2012 at 08:44.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  7. #7
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: Strange IT behaviour

    I asked directly Darrel Taylor (Technical Support) and he gave be the good answer :

    I simply need to clear the interrupt flag (TMR2IF) in PIR1 before leaving the Interrupt Service Routine


    Otherwise, the ISR is called again and again. No relation with ReadCode execution time.

    Many thanks to you, Darrel.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts