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

    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

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


    Did you find this post helpful? Yes | No

    Default

    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 the
    Code:
    LATF = LATF ^ 1
    line? 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.
    -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
    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

  4. #4
    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!

  5. #5
    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!

  6. #6
    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

  7. #7
    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!

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