[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
URL:
  <http://savannah.nongnu.org/bugs/?47937>

                 Summary: Incorrect "0" suffix in names of SPI registers and
bits for ATmega324PA and ATmega164PA
                 Project: AVR C Runtime Library
            Submitted by: davidegrayson
            Submitted on: Mon 16 May 2016 09:59:03 PM GMT
                Category: Header
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Header files
                  Status: None
        Percent Complete: 0%
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 2.0.0
           Fixed Release: None

    _______________________________________________________

Details:

The attached patch fixes the names that avr-libc defines for several
SPI-related registers in iom324pa.h and iom164pa.h.  The datasheets call the
registers SPCR, SPSR, and SPDR, but avr-libcs's definitions had "0" at the end
of the name: SPCR0, SPSR0, and SPDR0.  The names of bits defined in these
registers were wrong in the same way.  This patch adds new definitions with
the correct names, while leaving the old definitions around for backwards
compatibility.

Please apply the patch.  Thanks!



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 16 May 2016 09:59:03 PM GMT  Name: spi_fix_m164pa_m324pa.patch
Size: 1kB   By: davidegrayson

<http://savannah.nongnu.org/bugs/download.php?file_id=37181>

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #1, bug #47937 (project avr-libc):

Actuall, the datasheet is inconsistent on this: in the register
summary at the end, the bits do have the 0 suffix, while the
description omits them.

Likewise, the Atmel Studio XML files (where our header files
have been derived from) also uses the 0 suffix.

So please file a bug report with Atmel so they get all their
documentation and description files consistent.

Due to the inconsistencies, I think the way for us to fix it
is by supplying both definitions.

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #2, bug #47937 (project avr-libc):

Hello, Joerg.  I have seen your name a lot over the years during my
AVR-related work, so it is nice to hear from you.

Yes, the datasheets look inconsistent, and the XML files in C:Program Files
(x86)AtmelStudio7.0packsatmelATmega_DFP1.0.98atdf seem to be incorrect.  I
plan to write to Atmel support.

As you said, we should supply both definitions.  That's what my patch does; it
only adds definitions and does not remove any.

--David

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #3, bug #47937 (project avr-libc):

While I was researching my bug report to Atmel, I noticed a new part
definition file in Atmel Studio 7.0.934: the ATmega324PB.  This part will have
two SPI modules, so it makes sense that all of its SPI registers and bits are
suffixed with 0 and 1.  I suspect that Atmel is purposely renaming the SPI
registers on the old parts for consistency's sake.  They renamed the SPI
registers for the ATmega164{A,P,PA} and ATmega324{A,P,PA}, but they have not
yet done it for the ATmega644* or ATmega1284*.

I will still contact them anyway, because I noticed an inconsistency: in
ATmega164A.atdf they defined a bit to be named SPR01 when they really meant
SPR10.  That's definitely an error, but in general their adding of these
prefixes might not be an error.

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #4, bug #47937 (project avr-libc):

OK, great if your patch maintains both names.  I'll apply
it shortly then.

Quite possible Atmel tried to maintain some "forward
consistency" (they did it in other situations that way in
the past, e.g. USART bit names), but the datasheet and XML
description ought to match, no matter what.

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Update of bug #47937 (project avr-libc):

                  Status:                    None => Confirmed              


    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #5, bug #47937 (project avr-libc):

An Atmel tech support representative has told me that he will file a bug
report, but did not give any other useful information.

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #47937] Incorrect "0" suffix in names of SPI registers and bits for ATmega324PA and ATmega164PA

Joerg Wunsch-6
Follow-up Comment #6, bug #47937 (project avr-libc):

Hey, it looks like my patch has not been applied to avr-libc.  This is just a
reminder to do that.

    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Loading...