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.
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!
Well I have no idea whats wrong, and seemingly no way to figrue it out, so for now I will just leave the LAT in. I have re-defined what output it flips so as not to be in the way of my actual use. So far I have tried rem ('), and erasing the whole line. on both tests I just compile and program, board stays in interupt. (Or just sits somewhere). un rem or put the line back in and volia it runs again. I did this about 20 times just to be sure it wasn't something I was doing. I even replaced it with a @NOP just to see if it was some kind of memory placement hic-cup.
One thing I didn't think to try was changing it to toggle a variable instead of an output. I will try that tonight.
On the good news side of things, The board and program work as desired (as long as LAT line is there). Now for some cleanup things and add in the serial com to change things like spindle speed. I am sure there will be more issues when this is attempted, but hey, thats all the fun
Phase 1 almost complete!
-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!
That's too bad.
I was going to suggest doing it a different way.
If the inputs on PORTA were moved to PORTB, you could use the IOC interrupts to transfer everthing to PORTC.
Then it only interrupts when the pins change, leaving much more time for the main program.
Oh well, too late.
DT
Bookmarks