Shop OBEX P1 Docs P2 Docs Learn Events
MCP23016 speed question, buttons and a 20x4 LCD — Parallax Forums

MCP23016 speed question, buttons and a 20x4 LCD

BitsBits Posts: 414
edited 2012-09-13 15:41 in General Discussion
Currently I am running the MCP23016 to a 20x4 LCD and its working pretty good, I did have to fudge some things in my object to make it work decent. With spin I get a good looking simple screen as long as I don't update every character quickly it works.

I wanted to know if you think it could also run a 2x3 matrix of buttons? I only ask because the display requires some time to update, I have already seen flickering if I change an entire line of the display rapidly. I think this is because I borrowed an object and modified it a lot. The buttons require denouncing time as well so keep this in mind.

I will set up a prototype but in case I get a snag I wanted to ask. I also want to read the screen using this I/O IC but that's another day.

Comments

  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-13 14:47
    Bits wrote: »
    Currently I am running the MCP23016 to a 20x4 LCD and its working pretty good, I did have to fudge some things in my object to make it work decent. With spin I get a good looking simple screen as long as I don't update every character quickly it works.

    I wanted to know if you think it could also run a 2x3 matrix of buttons? I only ask because the display requires some time to update, I have already seen flickering if I change an entire line of the display rapidly. I think this is because I borrowed an object and modified it a lot. The buttons require denouncing time as well so keep this in mind.

    I will set up a prototype but in case I get a snag I wanted to ask. I also want to read the screen using this I/O IC but that's another day.

    No problem. Simply kick off another cog with a few I/O lines to create an N*M matrix scan array. Won't slow display cog (but better if you bumped it off into its own cog though). If it is in the main cog and just keeping up, added functions may degrade the display performance. The prop ed manual shows how to do multiple cogs. There is also a 74 series chip that will do the scan function for you. Be sure th allow for debounce of switches.

    Good luck,
    FF

    Ooooppps, never mind, crossed out of prop forum. Sorry 'bout that.
  • BitsBits Posts: 414
    edited 2012-09-13 15:41
    This runs using the i2c protocol so calling other cogs might not be a good idea since I am running one cog just for all my i2c devices. This is why I asked about speed I think that its ~ 400Khz using that protocol.
Sign In or Register to comment.