Setting up, say D2, as an INT pin on the Itsy Bitsy M4

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

adafruit_support_mike wrote:Actually I need to confirm something.. I think you might have found a bug in the board support package:

Mike,
I am anxious to hear what you have concluded on the aledged "bug" with it.
Bill

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by adafruit_support_mike »

Still waiting for information from people testing it. So far, the answers have been ambiguous.

From what I can see in the BSP code, the digitalPinToInterrupt() macro just echoes back the pin number, which doesn't line up with the interrupt channels actually connected to the pins on that board. People seem to have a hard time reducing that to simple 'yes' or 'no' answers though.. half the time they say the interrupt works if they skip digitalPinToInterrupt() and call attachInterrupt() with the interrupt channel number, and half the time they say the macro works.

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

adafruit_support_mike wrote:Still waiting for information from people testing it. So far, the answers have been ambiguous... half the time they say the interrupt works if they skip digitalPinToInterrupt() and call attachInterrupt() with the interrupt channel number, and half the time they say the macro works.
Curiously non-binary. The jury is still out then... Thanks for the update. Will stay tuned.

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

[quote="jramson"]One of the good information thanks for sharing.....MODERATOR EDIT: LINK REMOVED

Is this a Robo-linked advertisement for a baby monitor? My "baby" is a boy - 51 years old in December. A Robo for AARP might be more appropriate. : €

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by adafruit_support_mike »

That was just a link spammer.. one tactic is to make posts with innocuous content and throw in a link to whatever they're trying to shill.

We nuke them and ban the URLs whenever we spot them.

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

Outstanding. Thanks.

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

adafruit_support_mike wrote:Thank you. I'll have to dig into it further.

The digitalPinToInterrupt() macro's job is to save people from having to look up interrupts in the datasheet, and if it's broken we'll need to fix it. I'll poke around some more and see if I can make sense of things.

Hi Mike,
You had updated the board package and we had successfully used D3 as a Interrupt pin by :

attachInterrupt( 3, ISR, FALLING)

After about a year of great operations, we added hardware and used D4 in addition to D3 existing INT function. But, D4 will not behave the same. In fact it ignores any attempt to “attachInterrupt(4,[ISR] , FALLING).

I am wondering if, back when we discovered this prob initially, you fixed D3 in the boards package but that’s where it ended? I have spent a few days on this including actually accidentally frying a good Itsy Bitsy when I “force fed” the pin D4 trying to generate a interrupt response. Arrggg... reorder from Digikey). Could you please take a look? Thank you.

Gov

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

Mike,

HISTORICAL NOTE: While the original title mentions "D2", it was easier to use D3/D4 (side-by-side) and on the end of the ItsyBitsy breakout. The choice to use D4 in addition to D3(which works) instead of D2 and D3 was purely out of consideration for my PCB layout and fabrication. So, the thread's integrity is maintained. However, because I had assumed that when the original support 'fix' did in fact provide D3 attachInterrupt functionality, I assumed that the functionality was to extend to other pins, as implied. It wasn't until after PCB board fabrication and the discovery that D4 INT functionality could not be coded, that I return here to please ask that the boards package be updated to include other pins besides D3 alone.
//=========================
I did extensive testing and confirmed that, indeed, back when we worked together to get D3 on the Itsy Bitsy to function properly with the attachInterrupt(), that's where the 'fix' must have ended. I performed a so-called 'boards UPDATE' just to see if perhaps this support 'fix' may have subsequently been done but the UPDATE failed to help. So, while we made some progress and have at least a single INT-capable pin on the ITSY BITSY, it would be desirable I believe to replicate whatever you had done to correct the issue for D3 (in the Boards Package, I assume.) I would go in to the package and poke around but I really don't wish to create a 'fork' that is unique and would be obliterated by any subsequent boards package updates.
//=========================
OBTW, I spend a great deal of time being very meticulous about the following test to determine functionalities. I sent my test setup and code out for a second opinion and double-check of my code/wiring. I didn't have any doubt about it but taking this step alleviates any concerns that this was a valid test. I can assure you that it was. I hope that 'support' can provide the necessary boards update or, in the absence of that, please post the applicable section of boards code here that fixed the D3 functionality and I will, as a last resort, create my own 'fork' for use with these Itsy Bitsy M4s. (I have quite a few as you know). Thanks Mike.
//=========================
The following code represents the content that is germane to this topic. If you need something further, or clarification, please let me know. I'm happy to do it.

Code: Select all

   

    // standard libraries #included  

    #define INT1_pin 3      //  Itsy Bitsy  D3
    #define INT2_pin 4     //  Itsy Bitsy  D4

void setup() {

 // When enabled, this next line ( 'attachInterrupt' code ) properly creates
//  a functional INT-capable pin D3 and the pin responds perfectly
//  when pulsed as it should. 

       
    /* attachInterrupt (INT1_pin, ISR_CLIENTS_DATA_READY, RISING);  */
      
 // But any attempt use the exact same code to implement D4 as
 // an INT in the exact same circuit fails. D4 simply cannot be
 // coded to work as an INT pin in the proper way (or in any way, for that matter).

   // Pulsed when Metro-Mini's RFM69 array has data.
  // RIGOL Scope: pulse width and level OK
           
             // The following will NOT create an INT-capable D4.
            
             attachInterrupt (INT2_pin, ISR_CLIENTS_DATA_READY, RISING);  

}  // end setup()

void loop(){
  
  if (I2C_RF69_CLIENT_data_ready_FLAG == true){
      // do stuff
  }

} // end loop()         


//=================================
   Void ISR_CLIENTS_DATA_READY( ) {

           I2C_RF69_CLIENT_data_ready_FLAG = true;
    
    }

/*
//=========== Conclusion:   When I wrote my original support request, neither D3 nor D4 would function but we focused on D3 and, kudos to you in modifying the package to get it working .  But, as I discovered recently when implementing D4 is that we forgot to fix it as well.  Clearly, D4 will not function as does D3.  This is a spanking-new ItsyBitsy and I’ve exercised extreme care to ensure no errors on my part (hardware) nor software. It's a valid test and I was happy to contribute my time on it but now, as a hardware engineer,  we're out of my pay grade to be modifying 'Adafruit Boards Packages', (assuming I'm correct on the root cause). Any attention to this would be appreciated. 

I'm dead in the water without your support. 


*/

User avatar
Govner
 
Posts: 175
Joined: Wed Sep 14, 2016 4:42 pm

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by Govner »

Govner wrote:
adafruit_support_mike wrote:Actually I need to confirm something.. I think you might have found a bug in the board support package:

Hi Mike,

Not to be pushy but I keep checking back here hoping to hear something definitive/final. I am designing a new PCB assembly and if this ItsyBitsy M4 issue I've researched/confirmed is no longer a product support concern, that's fine but I would appreciate having that info in evaluating my next move/choices for MCU solutions.

Again, I'm not wishing to impose and will drop the M4 if you can please just kindly relay a simple note as to whether the M4 boards package will or will not likely be updated as when the first bug was discovered (i.e., before we successfully resolved the D3 issues/trials/updates). Thanks a bunch. I have no problem proceeding in either direction.

Stay safe.

User avatar
qniens
 
Posts: 11
Joined: Tue Jul 30, 2019 3:14 am

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by qniens »

Hello,
I know this is a old thread but I think I run into the same issue with the ItsyBitsy M4 and interrupts:
viewtopic.php?f=19&t=180411

Mapping only seems to work in D2, that is how I found this thread.

User avatar
qniens
 
Posts: 11
Joined: Tue Jul 30, 2019 3:14 am

Re: Setting up, say D2, as an INT pin on the Itsy Bitsy M4

Post by qniens »

adafruit_support_mike wrote:Still waiting for information from people testing it. So far, the answers have been ambiguous.

From what I can see in the BSP code, the digitalPinToInterrupt() macro just echoes back the pin number, which doesn't line up with the interrupt channels actually connected to the pins on that board. People seem to have a hard time reducing that to simple 'yes' or 'no' answers though.. half the time they say the interrupt works if they skip digitalPinToInterrupt() and call attachInterrupt() with the interrupt channel number, and half the time they say the macro works.
Yes the digitalPinToInterrupt() macro just echoes back the pin number on the Itsybitsy M4

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”