My project is starting


Closed Thread
Results 1 to 40 of 92

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    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!

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Well here is the modification:
    Code:
    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
    As you can see. the only change between last post and this is
    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!

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I do not see that problem here.
    It doesn't make any difference when the LAT line is commented.
    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 ^4
    Please tell me that this 5uS doohicky is not running a hobby servo????
    Would 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!!
    -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!

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Update

    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!

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    On the good news side of things, The board and program work as desired (as long as LAT line is there).
    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

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