Interrupts on AXE007M

markdil

New Member
When using the interrupts on the 08M chip, the manual just talks about polling the "inputs". Can it poll an output also and check its state? In other words, let's say pin1 is an LED (output) and pin2 is an input button (normally high). I want to set an interrupt to check to see if the LED is on (high) and if the button is pushed (low). Can I do this? I tried it and it seems to work, but the manual just talks about polling the inputs and not polling the state of an output pin. Thanks,

Mark
 

MartinM57

Moderator
Have a look at the READOUTPUTS command in Manual 2 - should solve your problem ;)

EDIT: But of course, presumably only your code turns the LED on/off, so you could remember in your code whether the LED is on or off?
 
Last edited:

hippy

Ex-Staff (retired)
You can interrupt on output state because of the way the 08M works internally; the outputs used to drive a LED ( or whatever ) are also fed back in as inputs which can be used to interrupt on. This doesn't always work ( depends on what the output connects to ) but usually does.
 

BeanieBots

Moderator
The best way is keep track of your output in code, for example with bit variable.
Then have your input trigger an interrupt in the normal manner but only "do whatever" if the bit is set. Otherwise, simply exit the interrupt routine without doing anything.
 
Top