Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifying naming of interrupt vectors on new AVR MCUs #16

Closed
trembel opened this issue Nov 23, 2020 · 5 comments · Fixed by #19
Closed

Clarifying naming of interrupt vectors on new AVR MCUs #16

trembel opened this issue Nov 23, 2020 · 5 comments · Fixed by #19
Labels
enhancement New feature or request

Comments

@trembel
Copy link
Contributor

trembel commented Nov 23, 2020

New AVR MCUs contain a list containing all interrupts, similar to the following (attiny412.atdf):

      <interrupts>
        <interrupt index="1" module-instance="CRCSCAN" name="NMI"/>
        <interrupt index="2" module-instance="BOD" name="VLM"/>
        <interrupt index="3" module-instance="PORTA" name="PORT"/>
        <interrupt index="6" module-instance="RTC" name="CNT"/>
        <interrupt index="7" module-instance="RTC" name="PIT"/>
        <interrupt index="8" module-instance="TCA0" name="LUNF"/>
        <interrupt index="8" module-instance="TCA0" name="OVF"/>
        <interrupt index="9" module-instance="TCA0" name="HUNF"/>
        <interrupt index="10" module-instance="TCA0" name="CMP0"/>
        <interrupt index="10" module-instance="TCA0" name="LCMP0"/>
        <interrupt index="11" module-instance="TCA0" name="CMP1"/>
        <interrupt index="11" module-instance="TCA0" name="LCMP1"/>
        <interrupt index="12" module-instance="TCA0" name="CMP2"/>
        <interrupt index="12" module-instance="TCA0" name="LCMP2"/>
        <interrupt index="13" module-instance="TCB0" name="INT"/>
        <interrupt index="14" module-instance="TCD0" name="OVF"/>
        <interrupt index="15" module-instance="TCD0" name="TRIG"/>
        <interrupt index="16" module-instance="AC0" name="AC"/>
        <interrupt index="17" module-instance="ADC0" name="RESRDY"/>
        <interrupt index="18" module-instance="ADC0" name="WCOMP"/>
        <interrupt index="19" module-instance="TWI0" name="TWIS"/>
        <interrupt index="20" module-instance="TWI0" name="TWIM"/>
        <interrupt index="21" module-instance="SPI0" name="INT"/>
        <interrupt index="22" module-instance="USART0" name="RXC"/>
        <interrupt index="23" module-instance="USART0" name="DRE"/>
        <interrupt index="24" module-instance="USART0" name="TXC"/>
        <interrupt index="25" module-instance="NVMCTRL" name="EE"/>
      </interrupts>

The module-instance is neglected at the moment, leading to a bad naming of the addresses, e.g. CMP0 - without informations on the peripheral:

      <interrupt>
        <name>NMI</name>
        <value>1</value>
        <description>&lt;TBD></description>
      </interrupt>
      <interrupt>
        <name>VLM</name>
        <value>2</value>
        <description>&lt;TBD></description>
      </interrupt>
      <interrupt>
        <name>PORT</name>
        <value>3</value>
        <description>&lt;TBD></description>
      </interrupt>
      ...
@trembel
Copy link
Contributor Author

trembel commented Nov 23, 2020

Additional informations in #15

@Rahix Rahix added the enhancement New feature or request label Nov 24, 2020
@trembel
Copy link
Contributor Author

trembel commented Nov 24, 2020

What about naming the fields "module-instance_name", iff module-instance is available? As far as I've seen now (attiny412.atdf and AVR128DA28.atdf), the module-instance only shows up in the interrupt map.

@Rahix
Copy link
Owner

Rahix commented Nov 24, 2020

Yeah, this is what I was thinking as well. Though we need to check whether this regresses any of the "old" ATDF files. It might also be worth it to look at the C headers, how they name interrupts on the newer MCUs.

@trembel
Copy link
Contributor Author

trembel commented Nov 24, 2020

iotn412.h - Header of attiny412:

/* ========== Interrupt Vector Definitions ========== */
/* Vector 0 is the reset vector */

/* CRCSCAN interrupt vectors */
#define CRCSCAN_NMI_vect_num  1
#define CRCSCAN_NMI_vect      _VECTOR(1)  /*  */

/* BOD interrupt vectors */
#define BOD_VLM_vect_num  2
#define BOD_VLM_vect      _VECTOR(2)  /*  */

/* PORTA interrupt vectors */
#define PORTA_PORT_vect_num  3
#define PORTA_PORT_vect      _VECTOR(3)  /*  */

/* RTC interrupt vectors */
#define RTC_CNT_vect_num  6
#define RTC_CNT_vect      _VECTOR(6)  /*  */
#define RTC_PIT_vect_num  7
#define RTC_PIT_vect      _VECTOR(7)  /*  */
...

This are all AVR targets containing the module-instance keyword:

  • ATmega1608
  • ATmega1609
  • ATmega3208
  • ATmega3209
  • ATmega4808
  • ATmega4809
  • ATmega808
  • ATmega809
  • ATtiny827
  • ATtiny826
  • ATtiny824
  • ATtiny817
  • ATtiny816
  • ATtiny814
  • ATtiny807
  • ATtiny806
  • ATtiny804
  • ATtiny427
  • ATtiny426
  • ATtiny424
  • ATtiny417
  • ATtiny416
  • ATtiny414
  • ATtiny412
  • ATtiny406
  • ATtiny404
  • ATtiny402
  • ATtiny3217
  • ATtiny3216
  • ATtiny214
  • ATtiny212
  • ATtiny204
  • ATtiny202
  • ATtiny1627
  • ATtiny1626
  • ATtiny1624
  • ATtiny1617
  • ATtiny1616
  • ATtiny1614
  • ATtiny1607
  • ATtiny1606
  • ATtiny1604
  • ATtiny416auto
  • AVR32DA28
  • AVR32DA32
  • AVR32DA48
  • AVR32DB28
  • AVR32DB32
  • AVR32DB48
  • AVR64DA28
  • AVR64DA32
  • AVR64DA48
  • AVR64DA64
  • AVR64DB28
  • AVR64DB32
  • AVR64DB48
  • AVR64DB64
  • AVR128DA28
  • AVR128DA32
  • AVR128DA48
  • AVR128DA64
  • AVR128DB28
  • AVR128DB32
  • AVR128DB48
  • AVR128DB64

(From the atdf's in Microchip ATautomotive Series Device Support (2.1.39), Microchip ATmega Series Device Support (2.2.108),
Microchip ATtiny Series Device Support (2.5.116), Microchip AVR-Dx Series Device Support (1.6.88))

@Rahix
Copy link
Owner

Rahix commented Nov 24, 2020

Okay, that does not seem to include any of the "old" chips which I was worried about ... And the C header does look like it is doing the same thing you proposed so I think this is the way to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants