Programming Arduino GPIO

userHead marqswitch 2017-01-31 08:17:02 2548 Views1 Replies
Hi All,

So I have been googling for some time and playing around with a plain old leonardo board trying to come up with a GPIO program for the project that I am working on. I will post my code further on when I call it "complete."

I am going to be using the GPIO mostly as general I/O. However I will be using pins D2 and D3 for I2C and also 2 lines will be used as SPI slave select lines for a couple of peripheral microcontrollers (ATmega32M1). I want to program an interrupt but I am not naturally an Electrical Engineer (I'm a CS guy), so understanding what my software is doing tends to be my obstacle. What I am curious about is what should I be considering when deciding which pins I should be putting an interrupt on? Do I need them at all or are they just good practice? Is there a standard ISR that should be used or are they circuit-specific? (This is my lack of hardware knowledge)

If anyone could explain interrupts in their own way that would be great. Examples help as well, I have read far too many google references and my brain has had enough.

Thanks,
Dennis