Discussion:
[avr-libc-dev] [bug #47734] WDTO_4S and WDTO_8S are incorrect
anonymous
2016-04-19 00:53:03 UTC
Permalink
URL:
<http://savannah.nongnu.org/bugs/?47734>

Summary: WDTO_4S and WDTO_8S are incorrect
Project: AVR C Runtime Library
Submitted by: None
Submitted on: Tue 19 Apr 2016 12:53:02 AM UTC
Category: Header
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Header files
Status: None
Percent Complete: 0%
Assigned to: None
Originator Email: ***@gmail.com
Open/Closed: Open
Discussion Lock: Any
Release: 2.0.0
Fixed Release: None

_______________________________________________________

Details:

In the watchdog control register WDP3 is split by two bits from WDP2.

Values should be:
WDTO_4S 0x20
WDTO_8S 0x21

This is for atmel-8271 and atmel-2586.

Thanks




_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?47734>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
Joerg Wunsch
2016-04-19 05:57:37 UTC
Permalink
Update of bug #47734 (project avr-libc):

Status: None => Need Info

_______________________________________________________

Follow-up Comment #1:

What do you mean by "atmel-8271 and atmel-2586"?

In general, your remark is incorrect. Splitting off bit 3
is correctly handled in wdt_enable() itself.atmel-8271 and atmel-2586

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?47734>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
anonymous
2016-04-20 00:01:05 UTC
Permalink
Follow-up Comment #2, bug #47734 (project avr-libc):

Atmel-8271 is the spec for teh 168/328/P
Atmel-2586 for the ATTiny's

Okay I was using the define's to set the bits directly to enable only the
watchdog interrupt. Which is why I saw the problem then.

WDTCR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0) | WDTO_8S;

If wdt_enable() splits the bits that is fine.

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?47734>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
Joerg Wunsch
2016-04-20 04:55:28 UTC
Permalink
Update of bug #47734 (project avr-libc):

Status: Need Info => Invalid
Open/Closed: Open => Closed

_______________________________________________________

Follow-up Comment #3:

The WDTO_xxx constants are meant to be used together with
wdt_enable(), which also takes of everything else which is
required, not just the timeout value itself.

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?47734>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
Joerg Wunsch
2016-04-20 05:44:31 UTC
Permalink
Follow-up Comment #4, bug #47734 (project avr-libc):

I added a remark in the comment of these constants, telling
that their values does not match the control register's bit
pattern.

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?47734>

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

Loading...