@Frido how are you including the LCD library into your project?
@Frido can you post your code and wiring scheme. Iām guessing you meant I2C, not SPI right? Have you added pull-up resistors on both SDA and SCL? Not sure what you meant by does not depend on pull-up resistors, but without them the Spark Core wonāt send a high output. Arduino doesnāt need them, for low capacitance buses, because they turn on the weak pullups.
Code is copied from @Soulhuntreās recent post, changed to
#define MCP23008_ADDRESS 0x27
wiring scheme is simple
brown = GND
red = VCC
orange = SDA / D0
yellow= SCL / D1
pullup resistors on 3V3
LCD flickers for a moment nowā¦
Pullups should go to VIN if thatās whatās powering your LCD. Are those 1k? Probably fine if so. If they are 10k, might wanna also try lowering them to at least 4.7k in addition to the supply voltage change. Keep in mind the LiquidCrystal_I2C code is a work in progress port of Adafruitās I2C LCD backpack. I need to order one of everything weāre working on so I can help out more effectively.
EDIT: Just ordered an LCD I2C/SPI backpack and a 4-channel I2C safe level shifter from adafruit (just in case). @Soulhuntre what kind of driver chip does your LCD have? Or if you can point me to the datasheet that would be best. Just want to make sure I grab a comparable LCD out of my drawer full of them.
So I have a different i2c backpack from Adafruit that appears to use a slightly different chip. I tried loading the sketch Bdubs posted and it doesnāt seem to work. The backlight turns on but the first line is all block characters.
Itās this one: http://www.adafruit.com/products/714
It has a MCP23017 instead of the MCP23008. So how difficult would it be to adapt the library for the MCP23017. It seems to be similar. Adafruit also has an RGBLCDshield library as well thatās need for the backpack I have. Iām guessing it mostly handles the button controls though.
Not too difficult Iād say, but time consuming nontheless. Let me get the MCP23008 working reliably first and then we can turn to the MCP23017 after thatās done. Meanwhile you can try to duplicate my efforts with the MCP23008 just by looking at the original library and the files Iāve created. Or, if you want to send me a http://www.adafruit.com/products/714 Iād definitely be more than happy to do the testing to get it working reliably.
I was thinking of just going through it later and seeing if I can duplicate what you did with the MCP23008
Yours look similar to my cheap eBay LCD, so this code could work:
I think this is the version that is originally from @Iv4n. I stripped of some his custom stuff to make it more clean on my taste. I just build it this from online IDE to make sure addresses are like they should be.
The only resistor is one I soldered in place of that led jumper to make backlight a bit dimmer. Electronics arenāt my expertise, so Iām not sure if should add more of them in long run.
I managed to duplicate what BDub did to this Library. Hereās their Hello World sketch example with all the code. I didnāt understand fully what I was doing so it may not work well, I just copied the modifications to make it compatible.
PS how do you do those fancy code boxes.
Edit: it does work but then the screen freaks out after about 30 seconds or so.
\o/ āThis is how we do it!!!ā \o/
It works!!! Thanks a lot!!!
Nice idea to solder a resistor instead of the jumper!
So this is a solution for LCD with backboard āLCM1602 IIC V1ā. Could be copied to āLibrariesāā¦
Happy now,
Frido.
Update: Pullup resistors to 3V3 work as well. I like this because the wiring looks cleaner
Update: On my open WiFi uptime was two times over 17.000 secondsā¦
@gin that sounds like the same problem we were having with my port of the MCP23008. Gotta be something simple in there that I missedā¦ Iām hoping.
Yeah maybe. Bascially a bunch of Cs and Ss started appearing scrolling across and it kind of went from there.
I did notice that on the RGBLCD shield library there were some 16bit exchanges where the MCP23008 seemed to only have 8bit ones.
Yeah.... the latest Spark Core firmware lets me go between 30 and 200 seconds... but in the end it always freaks out.
It's ok, you're still my hero :: smile ::
Ken
Did you ever get any further with this?
FYI, didnāt get my LCD I2C/SPI backpack yetā¦ but when I do Iāll put more time into this. Probably coming today.
@BDub - if you want one of the Adafruit ones to play with, hit me in PM Iāll be happy to ship you a setup (LCD / backpack) to help you out.
Sorry I havenāt had a chance to look into this, Iāve had my hands (and fingers!) full with other projects. Iām sure youāre in good hands with @BDub though!