AVR128DA48 Event System

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

Hi !

 

I have  curiosity nano board avr128da48.

 

On this board user has  LED on pin PC6 (active low) and key on pin PC7.

 

My question is how to light up LED when key is pressed but with Event System (chapter 15) in datasheet, not with polling/interrupt on key pin ?

 

 

Thank you !

 

 

 

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

rj22 wrote:
My question is how to light up LED when key is pressed but with Event System (chapter 15) in datasheet, not with polling/interrupt on key pin ?

 

You want to do it fully in hardware, right?

The first thing is, you need to make sure PC6 is the output of either an event system channel (EVOUTx) or a LUT, or else it won't be possible.

You can see LUT1-OUT can be set to this pin.

 

So in general terms, you need to set PC7 as input to an event channel, connect that channel to a LUT1 input, and program the LUT1 with such a logic that the LED is on (LUT1-OUT = LOW) when you press the button.

 

This is actually a good exercise, because you learn about the event system and the custom logic at the same time.