External interrupt problem

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I use Tiny15 and I'm trying to use an external interrupt to turn on and off an LED. PB2 is the external interrupt pin and I have tried many ways to set up the interrupt but without any success. Do some of you know how to set up the interrupt so it might work?

Kind regards
Bengt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm sorry, but you *will* have to make yourself familiar with the datasheet of the device. You'll also need some basic electronics know-how.

Basically, to use an external interrupt, you'll have to

- enable *this* interrupt
- configure the trigger condition (level/edge)
- enable interrupts (in general)

These issues are typically resolved by writing certain bits / bit patterns to device specific control registers (cf. device documentation)

Furthermore, the physical event (interrupt) will start a software routine as soon as the interrupt is triggered. You will have to create ('write') this routine to provide some functionality.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you post an example of what you're trying to do, someone could give you some help.

admin's test signature