Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | Storing registers in embedded asm ISR

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Storing registers in embedded asm ISR - nora_elhennawy - Feb 24 11:48:50 2008

Hello
i want to verify truth of this statement in dc um:
"Either stand-alone assembly code or embedded assembly code may be used
for ISRs. The benefit of embedding assembly code in a C-language ISR is
that there is no need to worry about saving and restoring registers or
reenabling interrupts"
i am writting an isr and i have embedded asm in C and i based on above
statement i didnot store registers but as a result i faced a lot of
problems :for loop counters missed up,..etc

did i misunderstand above statment?

regards,
nora



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Physical location of serial port - IAN LEWIS - Feb 25 0:25:25 2008


Hello everyone i would like to know which pins on the Rabbit 3000 correspond the serial ports. I have been searching through all the material i have about Rabbit 3000 and has still been unsuccessful will some one help me please.
Thanks in advance
Ian
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Physical location of serial port - ebrains2003 - Feb 25 1:03:06 2008

--- In r...@yahoogroups.com, IAN LEWIS wrote:
>
>
> Hello everyone i would like to know which pins on the Rabbit 3000
correspond the serial ports. I have been searching through all the
material i have about Rabbit 3000 and has still been unsuccessful
will some one help me please.
> Thanks in advance
> Ian
> _________________________________________________________________
> Connect and share in new ways with Windows Live.
> http://www.windowslive.com/share.html?
ocid=TXT_TAGHM_Wave2_sharelife_012008
>

Which pin depends on the chip package you have (the LQFP or the
TFBGA). If you purchased a development kit, you should have received
a great big fold-out chart. The pinout for both packages is in the
lower left corner. Just look for TXA, RXA, TXB, RXB, TXC, RXC, TXD,
RXD (all located on the micro's port c). There are E & F serial
ports, as well. But if you are using a Rabbitcore module, you need
to refer to the schematic for your particular core. For example, the
RCM3700 schematic is located at
http://www.rabbit.com/documentation/schemat/090-0177.pdf. If you
look closely, you will see that serial port A is used by the
programming connector. Some of the other serial ports share common
header pins, so beware.



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Storing registers in embedded asm ISR - mehiegl - Feb 25 9:27:42 2008

As I understand it, the advantage of writing ISR's in C is that the
compiler takes care of all the entry and exit stuff, i.e. saving
registers, disabling/enabling interrupts, etc. Embedding asm from
there allows you to minimize the code required to do the tasks. You
can also write the entire ISR in C.

I have done this and gotten reasonable results for my needs.

The advantage of writing the whole ISR in asm is that you control
everything, which registers are saved and restored, etc. You can
optimize the code better than the compiler will. It can be painful if
you are not experienced in asm code.

--- In r...@yahoogroups.com, "nora_elhennawy" wrote:
>
> Hello
> i want to verify truth of this statement in dc um:
> "Either stand-alone assembly code or embedded assembly code may be
used
> for ISRs. The benefit of embedding assembly code in a C-language
ISR is
> that there is no need to worry about saving and restoring registers
or
> reenabling interrupts"
> i am writting an isr and i have embedded asm in C and i based on
above
> statement i didnot store registers but as a result i faced a lot of
> problems :for loop counters missed up,..etc
>
> did i misunderstand above statment?
>
> regards,
> nora
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Re: Storing registers in embedded asm ISR - Scott Henion - Feb 25 15:05:43 2008

nora_elhennawy wrote:
> Thanks for your reply,but i just wanted to confirm that embedding asm
> in c will take care of saving/restoring registers just like c
> functions
>
It will if you define the function as "interrupt"
--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
"No, I understand now," Auberon said, calm in the woods -- it was so
simple, really. "I didn't, for a long time, but I do now. You just can't
hold people, you can't own them. I mean it's only natural, a natural process
really. Meet. Love. Part. Life goes on. There was never any reason to
expect her to stay always the same -- I mean `in love,' you know." There were
those doubt-quotes of Smoky's, heavily indicated. "I don't hold a grudge. I
can't."
"You do," Grandfather Trout said. "And you don't understand."
-- Little, Big, "John Crowley"



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Storing registers in embedded asm ISR - nora_elhennawy - Feb 25 15:10:03 2008

Thanks for your reply,but i just wanted to confirm that embedding asm
in c will take care of saving/restoring registers just like c
functions

--- In r...@yahoogroups.com, "mehiegl" wrote:
>
> As I understand it, the advantage of writing ISR's in C is that the
> compiler takes care of all the entry and exit stuff, i.e. saving
> registers, disabling/enabling interrupts, etc. Embedding asm from
> there allows you to minimize the code required to do the tasks. You
> can also write the entire ISR in C.
>
> I have done this and gotten reasonable results for my needs.
>
> The advantage of writing the whole ISR in asm is that you control
> everything, which registers are saved and restored, etc. You can
> optimize the code better than the compiler will. It can be painful
if
> you are not experienced in asm code.
>
> --- In r...@yahoogroups.com, "nora_elhennawy" wrote:
> >
> > Hello
> > i want to verify truth of this statement in dc um:
> > "Either stand-alone assembly code or embedded assembly code may
be
> used
> > for ISRs. The benefit of embedding assembly code in a C-language
> ISR is
> > that there is no need to worry about saving and restoring
registers
> or
> > reenabling interrupts"
> > i am writting an isr and i have embedded asm in C and i based on
> above
> > statement i didnot store registers but as a result i faced a lot
of
> > problems :for loop counters missed up,..etc
> >
> > did i misunderstand above statment?
> >
> > regards,
> > nora
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Storing registers in embedded asm ISR - mehiegl - Feb 26 8:38:17 2008

If you declare the ISR function written in C with the "interrupt"
keyword the C code takes care of all the saving/restoring and
interrupts. The embedded asm does not need to concern itself with
any of it, just what you need it to do.
--- In r...@yahoogroups.com, "nora_elhennawy" wrote:
>
> Thanks for your reply,but i just wanted to confirm that embedding
asm
> in c will take care of saving/restoring registers just like c
> functions
>
> --- In r...@yahoogroups.com, "mehiegl" wrote:
> >
> > As I understand it, the advantage of writing ISR's in C is that
the
> > compiler takes care of all the entry and exit stuff, i.e. saving
> > registers, disabling/enabling interrupts, etc. Embedding asm from
> > there allows you to minimize the code required to do the tasks.
You
> > can also write the entire ISR in C.
> >
> > I have done this and gotten reasonable results for my needs.
> >
> > The advantage of writing the whole ISR in asm is that you control
> > everything, which registers are saved and restored, etc. You can
> > optimize the code better than the compiler will. It can be
painful
> if
> > you are not experienced in asm code.
> >
> >
> >
> > --- In r...@yahoogroups.com, "nora_elhennawy"
wrote:
> > >
> > > Hello
> > > i want to verify truth of this statement in dc um:
> > > "Either stand-alone assembly code or embedded assembly code may
> be
> > used
> > > for ISRs. The benefit of embedding assembly code in a C-
language
> > ISR is
> > > that there is no need to worry about saving and restoring
> registers
> > or
> > > reenabling interrupts"
> > > i am writting an isr and i have embedded asm in C and i based
on
> > above
> > > statement i didnot store registers but as a result i faced a
lot
> of
> > > problems :for loop counters missed up,..etc
> > >
> > > did i misunderstand above statment?
> > >
> > > regards,
> > > nora
> > >
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Storing registers in embedded asm ISR - nora_elhennawy - Feb 27 3:05:10 2008

thanks for your reply;i can now see my problem i wrote isr as follows
interrupt my_isr()
{
asm_func1();
}
asm_func1()
{
#asm
#end_asm
}
and asm_func1 did not store registers
calling this function outside isr made all my problems
thanks for your help

--- In r...@yahoogroups.com, "mehiegl" wrote:
>
> If you declare the ISR function written in C with the "interrupt"
> keyword the C code takes care of all the saving/restoring and
> interrupts. The embedded asm does not need to concern itself with
> any of it, just what you need it to do.
> --- In r...@yahoogroups.com, "nora_elhennawy" wrote:
> >
> > Thanks for your reply,but i just wanted to confirm that embedding
> asm
> > in c will take care of saving/restoring registers just like c
> > functions
> >
> > --- In r...@yahoogroups.com, "mehiegl" wrote:
> > >
> > > As I understand it, the advantage of writing ISR's in C is that
> the
> > > compiler takes care of all the entry and exit stuff, i.e.
saving
> > > registers, disabling/enabling interrupts, etc. Embedding asm
from
> > > there allows you to minimize the code required to do the tasks.
> You
> > > can also write the entire ISR in C.
> > >
> > > I have done this and gotten reasonable results for my needs.
> > >
> > > The advantage of writing the whole ISR in asm is that you
control
> > > everything, which registers are saved and restored, etc. You
can
> > > optimize the code better than the compiler will. It can be
> painful
> > if
> > > you are not experienced in asm code.
> > >
> > >
> > >
> > > --- In r...@yahoogroups.com, "nora_elhennawy"
> wrote:
> > > >
> > > > Hello
> > > > i want to verify truth of this statement in dc um:
> > > > "Either stand-alone assembly code or embedded assembly code
may
> > be
> > > used
> > > > for ISRs. The benefit of embedding assembly code in a C-
> language
> > > ISR is
> > > > that there is no need to worry about saving and restoring
> > registers
> > > or
> > > > reenabling interrupts"
> > > > i am writting an isr and i have embedded asm in C and i based
> on
> > > above
> > > > statement i didnot store registers but as a result i faced a
> lot
> > of
> > > > problems :for loop counters missed up,..etc
> > > >
> > > > did i misunderstand above statment?
> > > >
> > > > regards,
> > > > nora
> > > >
> > >
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )