Jump to content
Sign in to follow this  
Stringer

Code in the interrupt beginning

Recommended Posts

I want portb bit 1 to go high as a very first thing when (any) interrupt comes. Even before any compiler generated context saving. However, I don't want to disable the context saving.

 

So, how do I insert this line:

asm bsf _portb, 1

 

to the beginning of assembler label  "_interrupt__code"?

 

I hope I don't have to do that every time I compile, as I had to with CH Flash Basic.

Share this post


Link to post
Share on other sites

Hi Stringer,

 

this can be done by the script files in the script directory.

There are files with the ending *.pat .

You would have to  add your line of code to the insertion section of  the _interrupt_code.

There is more documentation on it in the text file about scripts.

 

Regards Uwe

Share this post


Link to post
Share on other sites

I tried it with following script:

Name: "B2 pin high"

Debug: off

Pattern:
00._interruptcode
bcf STATUS, RP0
bcf STATUS, RP1
bsf  _portb, 2

 

Not exactly what I wanted for?

Share this post


Link to post
Share on other sites
Guest Dave

Stringer,

 

Consider the implementing you own context saving.

 

First turn context saving off in the settings->option->compiler options tab dialog. Uncheck the context saving during interrupt.

 

Add you own code for context saving (copy the compile asm code), then you are in control

 

Regards

Dave

Share this post


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...
Sign in to follow this  

×
×
  • Create New...