Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] Two motor encoder code for avr

Status
Not open for further replies.

Do you think TO use both intrupts simultaneously can cause a error in reading the Two encoders???

so long as you keep the interrupt service routines short (e.g. increment a counter and acknowledge the interrupt) I don't see why there should be problems
 

I m getting problem in simulation only INT0 works but if there is no intrupt on pin INT0 then INT1 works
I have not used AVRs for some time but it sounds as though you may be getting continuous INT0 interrupts
what are you interrupting on? edge, level ?
perhaps you are not clearling the INT0 interrupt in the interrupt service routine ?

how good is the AVR simulator at handeling interrupts?
I always use real hardware for testing such things
 

The problem is continous intruppts on pin INT0 from motor encoder
i think i should use GIO pin to count the encoders reading
 

I believe it's a coding problem. Both interrupts should be programmed for "Any logical change on INTx generates an interrupt request", or alternatively rising or falling edge only.

You should have an idea about the expectable encoder pulse rate.
 

I believe it's a coding problem. Both interrupts should be programmed for "Any logical change on INTx generates an interrupt request", or alternatively rising or falling edge only.

You should have an idea about the expectable encoder pulse rate.

yup i check the motor encoder output from oscilloscope its about 2.85Khz for each encoder
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top