Is it a bug or am I just wrong?


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    OK, wait a minute ... sorry.
    I forgot, it's not using DT_INTS anymore.

    While the 16F1's do save context automatically, they do not reset BSR.
    Whatever bank it's in when the interrupt happens is the bank you are in when getting to the ISR.

    BSR = 0
    Should be the first statement in an ISR that is not using DT_INTS.

    Blushing ...
    DT

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


    Did you find this post helpful? Yes | No

    Default

    To be clear. MPSIM is how I solved the problem. My card not working is how I found there was a problem.

    OK, I think I get it now. PBP expects BSR to be cleared. So anything that happens in BANK 0 doesn't need to have bank 0 selected. That makes perfect sense. It also clears up why cnt doesn't inc even though the program just loops through the int over and over when it hangs. Cuz its in BANK 0!!

    So the only thing I don't get now is why it works for you in Protus. Hmmm, I have been thinking about getting this next year (they say support for 16F1xxx's should happen then), but things like this just scare me.

    Thanks for pointing out BSR=0 should be the first thing, I guess every so often I am not adding 1 to count right now. And THANK YOU so much for finally clearing this up for me. It has been a struggle for a couple weeks now.

    For the record, I have not been chasing a problem in MPSIM, the problem is in real life on a real life card. When the LED quit flashing, I knew there was a problem. It was real simple to keep reming the line, programming the actual chip, watch it fail. un-rem the line, program the actual chip, watch it run. After doing this over and over, I decided there was a problem I didn't understand and posted.
    -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