Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to increase the memory space for interrupt routine?

Status
Not open for further replies.

ernytony

Newbie level 6
Joined
Jun 30, 2005
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,376
it is possible to increase to the space of memory associated to one ruotine of iterrupt.
 

Re: interrupt

The answer is YES. But the solution is different, depending on the microprocessor you are using. In case of 8051 you can place a JUMP ADDR at the beginning of the memory associated to the interrupt handler and the an ADDR can be a location where you have enough memory. I think this solution should be feasable in all cases. In case of some microcontrollers you may have an interrupt handler table where you can specify the address of the beginning of the interrupt handler for each interrupt source.

Belsugului
 

Re: interrupt

I use pic 16f877 with PICC lite
 

Re: interrupt

Hi ernytony,

When you write a interrupt program in any C program, complier allocates memory space in microcontroller.

regrads,
 

Re: interrupt

I now.
I would to allocate more memory for an interrupt.
Can I do this?
how?
 

Re: interrupt

Hi ernytony,

When an interrupt begins, Program counter goes to interrupt service vector automaticly, and you can write a goto or jump command. So program branches out a interrupt subrutine.

For example, you write a program for pic. And you use internal time interrupt. When program is executed, a time interrupt begins any time then program counter shows 0x0004 interrupt vector adresse and you can write a command to branches to interrupt subrutine such as goto TIME_INTERUPT. And microcontroller executes subritune until return. After return program counter shows the adresse that interrupt began.

regrads,
 

Re: interrupt

asahin11 said:
Hi ernytony,

When an interrupt begins, Program counter goes to interrupt service vector automaticly, and you can write a goto or jump command. So program branches out a interrupt subrutine.

For example, you write a program for pic. And you use internal time interrupt. When program is executed, a time interrupt begins any time then program counter shows 0x0004 interrupt vector adresse and you can write a command to branches to interrupt subrutine such as goto TIME_INTERUPT. And microcontroller executes subritune until return. After return program counter shows the adresse that interrupt began.

regrads,

Before entering into an interrupt some registers are saved depending an the CPU used, and the interrupt flag is set, which inhibits more interrupts with the same or less priority to be handled. Because of that, interrupt handler procedures are finished with Return from interrupt command, mostly used mnemonic is IRET. That means, even if you place a JUMP or CALL you are still in the same interrupt procidure until an IRET instruction is executed.
When you branch with JUMP to another memory location you do not need to jump back to the interrupt address, you need to place an IRET instruction at the end of the set of instructions to whic you have jumped to.
When you CALL a subrutine you MUST use a RET, and not IRET, because you have modified the content of the stack (the address of the instruction immediatly after CALL is saved on the stack). After RET the instruction located immediatly after CALL is executed, which might be an IRET. Interrupt handler should always be termineted by an IRET in order to clear the interrupt flag and load from the stack the content of saved registers automatically.

Belsugului
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top