Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

at meg32

Status
Not open for further replies.

ranjot singh

New Member
hie all...does n e one knows how to use int0/int 1 in atmeg32. I couldn't understand how to do it. I have to write the code in C. I need two of my sensor inputs to be used as interrupts. please help .
 
I know how to do it. What is giving you the problem? Deciding which edge to use? Enabling the interrupt? Configuring the registers? Don't know how a part could get much simpler.
 
I couldn't get the c code for writing it. i mean i have to perform a particular function when say interupt1 is provoked. so i have to change instructions in the int1. how do i do that?
 
There is no preexisting set of INT1 instructions. There is a vector in low memory which points to a function that is to be executed when that interrupt occurs.

Depending on the compiler that you are using, there will be a way to designate a function as an interrupt function. It is then the job of the compiler and the linker to link that interrupt function with the vector which the processor goes to for that interrupt source. The compiler will also take care of saving and restoring the machine state and putting an interrupt return instruction at the end of the function.

I'm using CodeVision, so which compiler are you using?
 
AVR Studio does have a built in assembler. There is also a hint that it supports the free and open source gcc compiler. I think the OP was asking about C code. So once again which C compiler are we talking about? Were not going to be able to help you very much if we ask you a question and you give us an answer to a different question. What exactly do you expect from us? Clairvoyance? Astral projection? What?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top