laz, looks great! I can see an opportunity for some optimizations by using direct bit manipulation vs digitalWrite(). I have a working arduinio library for the ILI9341 for that exact display so I’ll take a look to see if there are any tweaks to the display setup or commands.
By connecting the SD pins on the board to the SPI bus and using a separate CS line you could use the SD library that BDub and I worked on and posted on his github.
Indeed, direct bit manipulation will be faster, but that’s too ninja for me. I’ll be more than happy to adjust the code based on your feedback. Looks like the screen is a bit dim compared to photos I’ve seen on Adafruit. Do you think it is normal or the screen does need 5V on LED pin for full brightness?
laz, I “blew” a backlight by powering it off 5V directly. It’s not blown but it is now dimmer than it was when I first got it. If you do use 5V, use a current limiting resistor (200 ohms or so). The specs call for 3.3V on the LEDs with an 80ma draw. I will pull my units out and do some testing.
I’ll play with the code you posted and do some tuning. Would having software SPI be useful to you?
Hi, I was just curious about the brightness. It is not that bad anyway. As I hooked the same screen to Arduino, it is possible that I also killed back-lit (not my fault, the site I bought it said “it is ok” :)) In regard of software SPI - original library had support for it, but as Spark Core has hardware SPI, I’ve removed it. I can put software SPI part back if someone needs it.
laz, I noticed slight differences in the ILI9141 initialization code from the one I have. I will hook up a display and see if the sequence I have works any better. The only reason I ask about software SPI is I have a “fast” version and for some people, they want to use different pins. So it’s all good if you don’t need it.
laz, it turns out the differences were negligible. One thing to note is that I was able to set the SPI clock to DIV2 without any problems except for the fact that it wast FAST!
Hello @laz and @peekay123,
do you know weather your library does also work for the ILI9341?
(since the registers seems to be pretty similar…)
I bought some of these displays and I would love to use them with my spark core…
I someone in the awesome spark-community may help me
@peekay123, I looked at the code so this is hardware SPI only, I’m starting to run low on pins to use with the P1. Do you know if the reset for the lcd is needed? If not, what functionality is lost if not used?
Also do you know if the spare 1-6 pins on the P1 will be built out to be available for use?
@wesner0019, @mtnscott has ported the due DMA library for the ILI9341 (I have begged him to post it!). Do you plan on using a touchscreen i/f like the STMPE610? The buydisplay unit you selected does not come with any touch interface.
@wesner0019, I believe the DMA library is not based on mfGFX though it could be adapted I suspect. A good project to look at is the fantastic BrewPi by @elco. He uses a 2.2" ILI9341 touchscreen display (using the STMPE610). You can find his Spark project libraries here.
@peekay123 Thanks. The 4 wire resistive touch can be connected directly to the spark is my understanding. Do you know the benefits of using the STMPE610?
@wesner0019, if you have 4 analog inputs to spare then yes, you can do that. The main benefits of the STMPE610 is the SPI interface and the extra I/O it offers.