0

External Interrupts on Trinket?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

External Interrupts on Trinket?

by ravewings on Wed Dec 04, 2013 10:11 am

I've been looking over the pinouts for the Trinket: http://learn.adafruit.com/introducing-trinket/pinouts ,but I'm not sure I understand it well enough. Are there any external interrupts on the Trinket microcontroller?

Thanks
ravewings
 
Posts: 10
Joined: Wed Nov 13, 2013 3:54 am

Re: External Interrupts on Trinket?

by adafruit_support_bill on Wed Dec 04, 2013 10:36 am

PB2 on the chip is INT0 (among other things) the sole external interrupt on the ATTiny85. This is brought out as GPIO#2 on the Trinket.

Image

adafruit_support_bill
 
Posts: 72781
Joined: Sat Feb 07, 2009 10:11 am

Re: External Interrupts on Trinket?

by docwisdom on Tue Aug 05, 2014 1:47 am

Sorry to dig up an old thread, but can you do external interrupt and I2C on the Trinket at the same time?
docwisdom
 
Posts: 1
Joined: Tue Aug 05, 2014 1:44 am

Re: External Interrupts on Trinket?

by adafruit_support_rick on Tue Aug 05, 2014 6:19 am

docwisdom wrote:can you do external interrupt and I2C on the Trinket at the same time?

Sure! Just don't use the interrupt pin for I2C.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: External Interrupts on Trinket?

by lukebo on Sat Nov 11, 2017 12:33 pm

Hi everyone,
sorry to dig out that old thread again!
I did not really understand your answer, Rick. My problem is as follows. I want to use the trinket to grab the signal of an anemometer (10101010101 with a certain frequency) and measure that frequency. The result must be sent over I2C to a master for further processing. If i use GPIO2 to measure the frequency using the (only) interrupt, how can i use it as I2C clock line at the same time!?!? Can the clock line be changed? I always thought that it is fixed?
Thanks for the help,
Luke

lukebo
 
Posts: 2
Joined: Sat Nov 11, 2017 12:22 pm

Re: External Interrupts on Trinket?

by adafruit_support_bill on Sat Nov 11, 2017 12:42 pm

The external interrupt would interfere with i2c. But you can use pin-change interrupts. Pin change interrupts (PCINTx) are supported on all of the GPIO pins.

adafruit_support_bill
 
Posts: 72781
Joined: Sat Feb 07, 2009 10:11 am

Re: External Interrupts on Trinket?

by lukebo on Sat Nov 11, 2017 12:46 pm

Thanks a lot for the keywords, Bill!

lukebo
 
Posts: 2
Joined: Sat Nov 11, 2017 12:22 pm

Please be positive and constructive with your questions and comments.