nevermind...
Robert
nevermind...
Robert
Last edited by Demon; - 8th February 2012 at 17:04.
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
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
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.
That's the sort of stuff we see in signatures here.Basic and very simple, but it does not work !
Robert
Not as dumb as yesterday!
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
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
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.
Bookmarks