Netduino home hardware projects downloads community

Jump to content


Photo

Events/Interrupts from I2C?


  • Please log in to reply
2 replies to this topic

#1 kettch

kettch

    New Member

  • Members
  • Pip
  • 7 posts

Posted 08 September 2012 - 04:54 AM

I've got an Adafruit RGB LCD Button Shield, and it uses I2C to talk to the LCD and buttons through an Mcp23017. Right now I'm able to poll the state of the buttons inside a while(true) loop. Is there a way to attach an interrupt or event of some kind to the mux pins? EDIT: I was thinking about this, and I guess I should explain what I'm trying to do. I'm displaying the temperature on the shield, but I'd also like to use the buttons to change options for the running program (this is a thermostat-type device). So, I need to poll the thermocouple (which is working fine if I poll it directly, or use a timer) and at the same time be able to react to button presses. Thanks

Edited by kettch, 08 September 2012 - 06:47 AM.


#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1572 posts
  • LocationCzech Republic

Posted 08 September 2012 - 09:39 AM

If I understand the device datasheet correctly, you should be able to connect its INTA, INTB outputs to Netduino pins, enable Interrupt-On-Change in GPINTENx register, then create an InterruptPort on Netduino and read the INTFx register to get the interrupt source (i.e. which button was pressed) in the event handler.

#3 MegaOhm

MegaOhm

    New Member

  • Members
  • Pip
  • 8 posts

Posted 13 October 2012 - 07:20 PM

I've got an Adafruit RGB LCD Button Shield, and it uses I2C to talk to the LCD and buttons through an Mcp23017. Right now I'm able to poll the state of the buttons inside a while(true) loop. Is there a way to attach an interrupt or event of some kind to the mux pins?

EDIT: I was thinking about this, and I guess I should explain what I'm trying to do. I'm displaying the temperature on the shield, but I'd also like to use the buttons to change options for the running program (this is a thermostat-type device). So, I need to poll the thermocouple (which is working fine if I poll it directly, or use a timer) and at the same time be able to react to button presses.

Thanks


I pursuing a similar project, were you able to get the shield to work as needed?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2010-2014 Secret Labs LLC  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.