This led me to believe that it might be a timing issue, where a certain code sequence might be running just fast enough to throw off the timing off enough to cause communication to fail. Oddly, the screen suddenly worked after changing one line of code for an equivalent that accomplished the same task. Even after I had what I thought should be a working version, however, I wasn’t having any luck. Once I thought I understood it, I sketched everything out on my whiteboard and started modifying the TFTLCD.cpp source file to use the correct pins during read/write operations on the Mega. I haven’t done a lot of Arduino programming, so it took me a little while to figure out the whole pin situation in the header files. Given more time, I’ll experiment with both methods and post speed comparisons. As of this writing, I’m focusing solely on using the screen as a shield, not wiring it externally.
The disadvantage to this method, as opposed to running wires to a detached screen, is that the data pins span three ports and are in no particular order, meaning several bit shifts and masks must be performed to get the data to/from the screen, slowing things down a bit.
Now that I have one in hand and have had the opportunity to spend an evening experimenting, I’ve been successful in getting all of the features working with an Aruino Mega 2560, using the screen as a shield. Several people have asked about using this touch screen shield with the Arduino Mega, but I didn’t have much advice to offer because I didn’t own a Mega until yesterday. This is an addition to my post about the Touch Screen Shield for Arduino UNO, so if you’ve landed here, that may be a good place to start for more information.