Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Writing to GIFR register

Writing to GIFR register

2006-02-07 by s_shahab_r

In mega16,I can read the GIFR register but I can't write to GIFR 
register(to write to external interrupt bits)and this instruction dont 
write to this register:
  out 0x3a,r24

Re: Writing to GIFR register

2006-02-07 by Dave VanHorn

--- In AVR-Chat@yahoogroups.com, "s_shahab_r" <s_shahab_r@...> wrote:
>
> In mega16,I can read the GIFR register but I can't write to GIFR 
> register(to write to external interrupt bits)and this instruction 
dont 
> write to this register:
>   out 0x3a,r24


Did you include the definition file?

The other thing is, writing 1's to the bits clears them.
You can't actually set the bits this way.

Re: [AVR-Chat] Re: Writing to GIFR register

2006-02-07 by Jim Wagner

One of Dave's points, which may not be totally obvious, is
that you can't set an interrupt flag by software! Writing a
"1" to the bit resets it. You can learn this by reading the
appropriate parts of the description of the GFR (and other
registers containing interrupt flags) quite carefully,

Jim

On Tue, 07 Feb 2006 18:58:57 -0000
 "Dave VanHorn" <dvh@dvanhorn.org> wrote:
> --- In AVR-Chat@yahoogroups.com, "s_shahab_r"
> <s_shahab_r@...> wrote:
> >
> > In mega16,I can read the GIFR register but I can't
> write to GIFR 
> > register(to write to external interrupt bits)and this
> instruction 
> dont 
> > write to this register:
> >   out 0x3a,r24
> 
> 
---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.