![]() While searching I found on SpenceKonde's DxCore pages on github some interesting explanation for the long time attachInterrupt() takes. Since there are no existing Arduino functions for CCL, the CCL Interrupt vector is still "free" (not in use by some Arduino Code). The advantage might be that CCLs are (still?) hardly used. Indeed this moves the problem from the pin interrupt routine (attachInterrupt()) to the CCL interrupt routine. It looks like there is ONE CCL interrupt. I have to check, however, if this also allows me to directly call my own interrupt handling functions. There I can bind a pin to the CCL / Event logic. One solution might be to use the Event or the Configurable Custom Logic (CCL) system of these newer processors. Therefore (as already mentioned in the reactions above), I can't write my own variant of attachInterrupt(). Since my code is supposed to go into a library, I can't make any assumptions about possible other pin interrupts from other libraries or the main sketch. Therefore the attachInterrupt()Īrduino call has to do extra work to determine to which pin the interrupt has to be associated, and thus which routine to call for handling the user specific part of the interrupt. The newer processors, like the 4809 (MegaCoreX and the AVR 128DA (DxCore), share for all pins connected to a certain port the same ISR vector and routine. The traditional AVR processors have a limited number of "real hardware interrupt" pins, each associated with their own ISR vector and thus routine. I now realise that indeed the differences in reaction time are caused by the differences in the "interrupt architecture". Use PF2 as output pin for the logic analyserĪttachInterrupt(digitalPinToInterrupt(InputSignalPin), test_interrupt, FALLING ) Īny idea what might cause this very long time between the time the interrupt signal appears, and the moment the ISR becomes active on the new Arduino Nano Every?įirst thanks for your reactions. I wrote the following test code: #define InputSignalPin 19 // INT2 om the Mega 2560 - PF3 on the Nano Every The input signal that triggers the interrupt is in both cases identical. I made a test setup with an Arduino Mega 2560 and an Arduino Nano Every. On the classical Arduino's it takes less than one microsec ( when compiling with board: "Arduino Mega or Mega 2560"), but on the Every it takes between 6 microseconds ( when compiling with MegaCoreX an board: "ATMega 4809 / Pinout: Nano Every") or even 8 microseconds ( when compiling with board: "Arduino Nano Every" / Registers Emulation: None"). However I noticed on my logic analyser quite a difference between the times interrups are raised and the ISR is entered. ![]() I have a bigger program moved from the traditional Arduino's (UNO, MEGA) to the Nano Every (4809).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |