Hello respected users of AVRfreaks forum. I am currently working on finishing papers for Masters degree study(As i am resident of Croatia we call it sort of diploma work and i can't really translate it into anything that would make sense in English) and my subject is automation of robotic arm or manipulator. I chose Fischertechnik 3-axis model for the simplicity. The project has 4 phases: Electronics, Micro controller programming, computer vision and embedding everything into a windows application. So you can guess I'm stuck at 2nd phase. As I'm total newbie(started it this week) in AVRs i need help setting the general framework for my project. I've read the tutorials on interrupts, USART, timers(PWM) so I can say that I understand the basics.
I'm using Arduino 2009 board with ATmega 168.
So basically what my uC should do is to get PWM values from the computer via USB and setting them to motors(through LMD18200 drivers), reading pulse counters(made of simple buttons), sending states of pulse counters to the PC and taking care of the edge detectors.
So after this lengthily introduction my first actual question: How should i handle buttons? My taught was to handle them each in interrupt routine. Then i taught that debouncing cycles could slow the uC down and the possibility of 2 or more buttons changing state in the approx. same time will make the uC to miss some pulses(as it was stated in one of tutorials that while one INT routine is active the others are disabled). So should i handle this in the main loop or is there any other smart way that i've missed.
Thanks a lot. Ivan