DFP inaccuracies for SAMC21N17A device

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

Thought it may be interesting/useful to post this on here...

 

We are currently working with the ATSAMC21N17A device, and have noticed errors in the DFP headers for this device. In particular, the pin assignments in samc21n17a.h.

 

Located in C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\SAMC21_DFP\1.2.176\samc21n\include\pio

 

All of the device pin assignments are incorrect, for example PIN_PA10 on the device is pin 40... but the DFP PIO headers are incorrect.

 

#ifndef _SAMC21N17A_PIO_
#define _SAMC21N17A_PIO_

#define PIN_PA00                            0  /**< \brief Pin Number for PA00 */
#define PORT_PA00              (_UL_(1) <<  0) /**< \brief PORT Mask  for PA00 */
#define PIN_PA01                            1  /**< \brief Pin Number for PA01 */
#define PORT_PA01              (_UL_(1) <<  1) /**< \brief PORT Mask  for PA01 */
#define PIN_PA02                            2  /**< \brief Pin Number for PA02 */
#define PORT_PA02              (_UL_(1) <<  2) /**< \brief PORT Mask  for PA02 */
#define PIN_PA03                            3  /**< \brief Pin Number for PA03 */
#define PORT_PA03              (_UL_(1) <<  3) /**< \brief PORT Mask  for PA03 */
#define PIN_PA04                            4  /**< \brief Pin Number for PA04 */
#define PORT_PA04              (_UL_(1) <<  4) /**< \brief PORT Mask  for PA04 */
#define PIN_PA05                            5  /**< \brief Pin Number for PA05 */
#define PORT_PA05              (_UL_(1) <<  5) /**< \brief PORT Mask  for PA05 */
#define PIN_PA06                            6  /**< \brief Pin Number for PA06 */
#define PORT_PA06              (_UL_(1) <<  6) /**< \brief PORT Mask  for PA06 */
#define PIN_PA07                            7  /**< \brief Pin Number for PA07 */
#define PORT_PA07              (_UL_(1) <<  7) /**< \brief PORT Mask  for PA07 */
#define PIN_PA08                            8  /**< \brief Pin Number for PA08 */
#define PORT_PA08              (_UL_(1) <<  8) /**< \brief PORT Mask  for PA08 */
#define PIN_PA09                            9  /**< \brief Pin Number for PA09 */
#define PORT_PA09              (_UL_(1) <<  9) /**< \brief PORT Mask  for PA09 */
#define PIN_PA10                           10  /**< \brief Pin Number for PA10 */
#define PORT_PA10              (_UL_(1) << 10) /**< \brief PORT Mask  for PA10 */
#define PIN_PA11                           11  /**< \brief Pin Number for PA11 */
#define PORT_PA11              (_UL_(1) << 11) /**< \brief PORT Mask  for PA11 */
#define PIN_PA12                           12  /**< \brief Pin Number for PA12 */
#define PORT_PA12              (_UL_(1) << 12) /**< \brief PORT Mask  for PA12 */

 

I've raised a support ticket with Microchip to see if they are aware/if there is a DFP update coming. Has anybody else come across this, or similar before?

 

On the other hand, maybe I've misunderstood the PIO header... after all, the header appears not to list pins all the way up to 100.

This topic has a solution.
Last Edited: Sat. Apr 23, 2022 - 11:18 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jtw_11 wrote:
On the other hand, maybe I've misunderstood the PIO header...

Yes this, there are only logical pin numbers in the header, think about it, why would your software depend on the physical pin numbering?

It would imply you might have to rebuild your SW if you made a new layout with the same device but in a different package.

jtw_11 wrote:
for example PIN_PA10 on the device is pin 40.

What? Looks like PC10 is pin 40.

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:
What? Looks like PC10 is pin 40.

 

It is, typo in my OP. Well spotted. PC10 is where this started for me...

 

OK now it makes sense, ironically the reason I was digging around in this header was to build an HAL layer header mapping pins, to ports, to application signal names as part of my usual practice working with AVRs and other MCUs. Clearly the work is done for me already with each pin group logically ordered in 32 bit wide ports.

 

Thanks for your sanity check!