Software PWM lockup on a 16F877A


Closed Thread
Results 1 to 14 of 14

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    With 18F's or 16F1's, you can get away with GOSUBing to other routines from the interrupt handler.

    But with 12F's and 16F's, you are limited by a very small Stack (8 levels).
    Most PBP statements only use 1 or 2, but a couple of them can use up to 4 levels, which only leaves 4 levels for your program and it's GOSUB's.

    When you get an interrupt, the hardware itself uses 1 level.
    When the interrupt happens, it could be 2 or 3 gosubs deep already in your main program.
    Then using Basic Language statements in the interrupt handler will want some more levels.

    If you use another level by gosubing from the handler, then you are really pushing your luck.
    It may work fine for some programs, but it could be catastrophic for others.

    With 18F's and 16F1's, there are plenty of stack levels to go around. But not with the "little" guys.
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default

    So far, she does run... however, i'm having a right mare with the comms hardware setup and the comms handler...(shakes head)
    Now that i have 6 18F4550's from crownhill i may revert the program back to using them...
    The program does sweet FA, everything is driven from interrupts, their is only the 'automatic' and 'manual' modes that have gosubs and they are correctly returned so i don't think it's over/under runs that are the problem now...

    I'll post more info later on, I'm going to take a break for a couple of hours and have a blast on CnC...

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