Skip to content

RemyEE/ATtiny817-External-Interrupt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

ATtiny817 External Interrupt using ATtiny817 Xplained Mini

Create New Atmel Start project

http://start.atmel.com/#board/ATtiny817XplainedMini

You can set pins as input or output on Atmel START project or do it later on your code.

Enable external interrupt

PORTC.DIR &= ~(1 << 5);			// Set User button as Input
PORTC.PIN5CTRL |= (1 << 1) | (1 << 0);	//Sense falling edge

sei();			// Enable Interrupt

Set a pin as output (my case: PC0)

PORTC.DIR |= (1 << 0);			// User led as Output

Handle Interrupt Service Routine

ISR(PORTC_PORT_vect) {
	PORTC.OUT ^= (1 << 0);
	PORTC.INTFLAGS |= (1 << 5);			// Clear Interrup Pin Flag, must do this to handle next interrupt
}

Check source code (main.c file only)

Buy me a Coffee

Buy Me a Coffee at ko-fi.com

About

ATtiny817 External Interrupt using ATtiny817 Xplained Mini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages