External Interrupts on Trinket?

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
ravewings
 
Posts: 10
Joined: Wed Nov 13, 2013 3:54 am

External Interrupts on Trinket?

Post by ravewings »

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

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: External Interrupts on Trinket?

Post by adafruit_support_bill »

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

User avatar
docwisdom
 
Posts: 4
Joined: Tue Aug 05, 2014 1:44 am

Re: External Interrupts on Trinket?

Post by docwisdom »

Sorry to dig up an old thread, but can you do external interrupt and I2C on the Trinket at the same time?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: External Interrupts on Trinket?

Post by adafruit_support_rick »

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.

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

Re: External Interrupts on Trinket?

Post by lukebo »

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

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: External Interrupts on Trinket?

Post by adafruit_support_bill »

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.

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

Re: External Interrupts on Trinket?

Post by lukebo »

Thanks a lot for the keywords, Bill!

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

Return to “USBtinyISP”