With Timer2 firing off every 5uS, you're not going to be able to do any meaningful single stepping.
The interrupt flag will be set again while you are looking at the last "step".
With Timer2 firing off every 5uS, you're not going to be able to do any meaningful single stepping.
The interrupt flag will be set again while you are looking at the last "step".
DT
well if Debug with ICD3 does not hold the timer to inc only on an instruction cycle, then that makes sense. Now to the real problem, any idea why I can't rem out theline? With it in the int routine, all seems to work. but if I rem it, it doesn't work. I am checking with a scope and not by single stepping. Also led5 doesn't blink. So I am assuming CNT is not being incremented, which to me says it is not getting out of the int.Code:LATF = LATF ^ 1
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
In your code from post #58, execution will "Fall into" the ISR, never making it to the Main loop.
Either put the handler after the main loop, or add a GOTO that jumps over the ISR.
DT
Well color me silly!! Ok, I will try that tonight when I get home, Thanks Darrel. I will post my success or failure, what ever the case may be.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Well here is the modification:
As you can see. the only change between last post and this isCode:DEFINE INTHAND _FiveMicroSec GOTO MAIN '---[TMR2 - interrupt handler]-------------------------------------------------- FiveMicroSec: LATG = LATG ^ 4 ; TOGGLE EN1 CNT =CNT+1 PORTC = PORTA PIR1.1 = 0 ; clear the interrupt flag @ RETFIE Main: 'DO WHATEVER YOU WANT HERE
addition of goto main and changed LATF to LATG. The goto main does seem to make it start better, but still can't rem the LATG - LATG ^4.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I do not see that problem here.
It doesn't make any difference when the LAT line is commented.
Please tell me that this 5uS doohicky is not running a hobby servo????
DT
Thats too bad. OK, I will keep struggling with it. The way I am deciding it doesn't work is like this. A) LED5 does not flash anymore, and B)even though you have pointed out I can't single step with TMR2, It does seem to when LAT is not remed. When it is remed, single step makes it appear to stay in the handler. But I have a few more ideas to try. Thanks for looking at it.
Maybe I am not reming correct. I am putting a ' in the beginning of the line. such as this
Code:' LATG = LATG ^4Would it be TOO much overkill?? No, The servo is just to check 1 output. The entire card is a 4 axis controller with a control for a brushless spindle motor driven from a hobby ESC. The 5uS int is to make sure no steps are missed from the controlling computer. When all is done, the machine is really a 6 axis machine with 2 of these cards running 3 axis each. All this just to cut foam airplanes!!Please tell me that this 5uS doohicky is not running a hobby servo????
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Bookmarks