Jump to content

Interrupts On Pic16f876


Recommended Posts

Disassembly of the hex code generated by BoostC Ver. 6.55 for a PIC16F876 shows that no code is produced for the ISR!! This is also the case looking at the listing file.

 

I can see the vector at address 0004, where there appears to be some code for context saving, a jump to a label 'interrupt' where there is more code that seems to be for context restoration ending with retfie; all of the code for the ISR is missing.

The program compiles/links without errors, but as a newcomer to this compiler I may be doing something wrong; for example, I am puzzled why the ISR function cannot be named - I guess because for this PIC there can only be one ISR.

Any help and/or education gratefully received.

Link to post
Share on other sites

Does your C code have a function called void interrupt()?

 

Could you post a minimal C program and the associated listing.

 

 

Disassembly of the hex code generated by BoostC Ver. 6.55 for a PIC16F876 shows that no code is produced for the ISR!!  This is also the case looking at the listing file.

 

I can see the vector at address 0004, where there appears to be some code for context saving, a jump to a label 'interrupt' where there is more code that seems to be for context restoration ending with retfie; all of the code for the ISR is missing.

The program compiles/links without errors, but as a newcomer to this compiler I may be doing something wrong; for example, I am puzzled why the ISR function cannot be named - I guess because for this PIC there can only be one ISR.

Any help and/or education gratefully received.

Link to post
Share on other sites
Does your C code have a function called void interrupt()?

 

Yes, actually void interrupt(void) with a prototype in a header file.

 

Could you post a minimal C program and the associated listing.

 

 

I'm reluctant to block up the system with what is quite a large source, as I suspect the problem lies elsewhere within the main body. I've noticed some (unexpected) error messages, like 'missing ;' as a result of a minor infringement in some seemingly unrelated section. 

I will produce a cut-down version with a minimal body but the same ISR code; whats the betting that will work?

 

Disassembly of the hex code generated by BoostC Ver. 6.55 for a PIC16F876 shows that no code is produced for the ISR!!  This is also the case looking at the listing file.

 

I can see the vector at address 0004, where there appears to be some code for context saving, a jump to a label 'interrupt' where there is more code that seems to be for context restoration ending with retfie; all of the code for the ISR is missing.

The program compiles/links without errors, but as a newcomer to this compiler I may be doing something wrong; for example, I am puzzled why the ISR function cannot be named - I guess because for this PIC there can only be one ISR.

Any help and/or education gratefully received.

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...