Controlling A Color TFT Display With PIC32

Sometimes it feels like everyone out there is using Arduino. It’s easy to find tutorials and libraries to get things working with Arduino, but if you want to use another platform you might have more trouble. [Tahmid] ran into this problem when he decided to try using a PIC32 to control a 2.2″ color TFT display from Adafruit.

Adafruit is really good about providing tutorials and Arduino libraries for their products. It makes it really easy to get up and running… if you are using Arduino. All of their libraries are open source, which means that the community can take them and modify them as needed. [Tahmid] decided to do exactly this and fork the Adafruit libraries over to the PIC32 platform in C. It’s a great learning experience. You get to see how (good or bad) other people code, and it immerses you in the differences between two different chip families.

He’s released the libraries online for others to use. He says that he’s heavily commented the code to try to make as self-explanatory as possible. The display interfaces with the PIC32 using SPI. The demo video below shows the screen up and running and demonstrates the crisp color graphics.

14 thoughts on “Controlling A Color TFT Display With PIC32

  1. I have that display running on dsPIC33, initially using a port of MSP430 example code that came with it, then a total rewrite with optimizations and some extra features. Was a fun three-day project. Though looking at the video demo, [Tahmid]’s port is nicer. Looks to be well optimized too, running very close to the maximum possible drawing speed. Well done!

    Note this display is available for a fraction of Adafruit’s price on Ebay, even with a touchscreen included. If you don’t mind waiting for shipment from China. And remember to flip the connections when plugging it into a breadboard, as the Chinese modules typically only have the silkscreen pin markings on the underside of the board. I didn’t and wasted a few hours before I realized my error, fortunately the module survived my brain fart without damage.

  2. I like both AVR and PIC micros and use them both. It is not very hard to find examples and libraries for PICs, for example you can find bunch of libs on , usually with source code so you can easily port them to work with your compiler. You can even port Arduino libs, PICs and AVRs are not very different. I’m not sure about this particular TFT, but LibStock has many libs for different TFTs, I guess this one is supported too.

      1. Not true. The PIC32’s CPU core is from MIPS, but that doesn’t matter much unless you’re porting assembly code. Otherwise, C takes care of the CPU code for you, and where you’ll typically the most time porting is accounting for differences in the MCU’s peripheral devices, interrupts, etc. Most of the peripherals on a PIC32 (I/O ports, ADC, SPI, I2C, timers, input/output capture, etc) are designed by Microchip, not MIPS, and when possible share similarity to their earlier versions. So porting from a PIC16 to PIC32 is normally easier than AVR to PIC.

    1. libstock uses almost only MikroC (and basic and pascal) compilers from mikroe (250$… )… the good ol piclist is much better, and free….. nice try creating publicity fer yer site… good job for the pic32 lib dude!

  3. I could not download the files to look at them without registering yet another account :(
    Why can’t we just have a link to download the files with a click?
    Still, I probably should not worry about having all these accounts everywhere, but I do loose track of them!!
    It would be interesting to see it all as I have boards with PIC32s on them.
    I may look elsewhere.

  4. It would be great if author shared it on something like github, or anything else than site which one can’t use without logging with something. I can’t download it, though I would read through it gladly (as fellow nonarduinoist :P)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.