avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bugs #8119] _wdt_write macro in wdt.h doesn't work with


From: Joerg Wunsch
Subject: [avr-libc-dev] [bugs #8119] _wdt_write macro in wdt.h doesn't work with ATmega169
Date: Tue, 13 Apr 2004 17:29:21 -0400
User-agent: Mozilla/5.0 Galeon/1.2.13 (X11; FreeBSD i386; U;) Gecko/0

This mail is an automated notification from the bugs tracker
 of the project: AVR C Runtime Library.

/**************************************************************************/
[bugs #8119] Latest Modifications:

Changes by: 
                Joerg Wunsch <address@hidden>
'Date: 
                Tue 04/13/04 at 21:29 (Europe/Berlin)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
         Assigned to | None                      | joerg_wunsch
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Suggested fix applied to <avr/wdt.h>.

Thanks for your contribution!






/**************************************************************************/
[bugs #8119] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=8119>
Project: AVR C Runtime Library
Submitted by: 0
On: Thu 03/11/04 at 19:34

Category:  Header
Severity:  5 - Average
Item Group:  None
Resolution:  Fixed
Assigned to:  joerg_wunsch
Originator Email:  address@hidden
Status:  Closed


Summary:  _wdt_write macro in wdt.h doesn't work with ATmega169

Original Submission:  The _wdt_write(value) macro in wdt.h doesn't work with 
the ATmega169. The problem is that Atmel moved the WDTCR register to location 
0x60, which is outside the range of an OUT instruction.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Tue 04/13/04 at 21:29         By: joerg_wunsch
Suggested fix applied to <avr/wdt.h>.

Thanks for your contribution!

-------------------------------------------------------
Date: Fri 04/02/04 at 07:09         By: None
SOLUTION:

The macro _wdt_write has to be changed for the ATmega169 in the following 
manner:

#define _wdt_write(value)                               
        __asm__ __volatile__ (                          
                "in __tmp_reg__,__SREG__" "nt"  
                "cli" "nt"                              
                "wdr" "nt"                              
                "sts %0,%1" "nt"                        
                "out __SREG__,__tmp_reg__" "nt" 
                "sts %0,%2"                             
                : /* no outputs */                      
                : "M" (_SFR_MEM_ADDR(WDTCR)),           
                  "r" (0x18),/* _BV(WDCE) | _BV(WDE) */ 
                  "r" ((unsigned char)(value))          
                : "r0"                                  
        ) 

The proposed code example form sfr_defs.h uses the _SFR_IO_REG_P() macro to 
distinguish between I/O and memory addresses, but this does not work for the 
169.













For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=8119>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]