0
\$\begingroup\$

I am new to embedded development, so please bear with me.

I have to interface a TFT display(ILI9341) with PIC18F452, it does not have any controller chip, I want to run a simulation with Proteus before getting the hands dirty with hardware. I am using mikroC PRO for coding PIC controller and trying to use the inbuilt library provided by mikroC for TFT (https://download.mikroe.com/documents/compilers/mikroc/pic/help/tft_library.htm) but I am not able to use the library and the hardware connections at end of the page does not help in how to connect pins to microcontroller.

So I want to ask:

1)Is mikroC good enough for interfacing a touchscreen and taking input from the user or should I use MPLAB-X.

2)How can I connect the pins to PIC controller, I have read the datasheet but I am not able to figure out should I use SPI or 8-bit bus interface and where the pins should be connected.

\$\endgroup\$
  • \$\begingroup\$ I don't recommend beginners try to interface a complex LCD display until you have more knowledge. Instead use a known-working set of h/w & s/w, get that to work, learn how it works, then develop your own. (a) "TFT display(ILI9341) [...] does not have any controller chip" Not true. The ILI9341 is the controller - without an LCD controller, you would be trying to interface your PIC with a "bare" LCD (difficult). (b) "should I use SPI or 8-bit bus interface" Different LCD modules using the ILI9341 controller, expose different i/f options. Choices depend on your specific LCD module. \$\endgroup\$ – SamGibson Jun 24 '17 at 10:53
  • \$\begingroup\$ @SamGibson I am trying to simulte ILI9341 and I have a ILI9341 h/w module so what do u mean by "specific LCD module" and in your opinion where should I learn from about PIC and using TFT module. \$\endgroup\$ – bha159 Jun 24 '17 at 17:04
  • \$\begingroup\$ "I have a ILI9341 h/w module so what do u mean by "specific LCD module"" - I will use your terminology, to try to help you - I mean that there are different versions of "ILI9341 h/w module". You didn't include a photo of yours, but I have seen different versions. For example, some only have connections to SPI i/f. Therefore if you have one of that type, then your question asking "should I use SPI or 8-bit bus interface" is already answered - you simply cannot use the 8-bit i/f (which exists on the ILI9341 IC) if your specific "ILI9341 h/w module" only provides connections for SPI. \$\endgroup\$ – SamGibson Jun 24 '17 at 20:36
  • \$\begingroup\$ @SamGibson here is the module I have imgur.com/a/3a72d ,so how should I interface it \$\endgroup\$ – bha159 Jun 26 '17 at 8:19
  • \$\begingroup\$ "how should I interface it" - Full instructions would be too long, so this is my last comment. As I said, it's often too complex for a beginner :-( In short: 3.3V signals only! Based on i/f pin names etc. your specific "ILI9341 h/w module" seems to be pre-configured for "8080 MCU 16-bit Bus Interface I" mode only (see ILI9341 datasheet) with 2 x SPI i/f for the XPT2046 touch IC and the SD card. I don't believe that module (unless modified) can use SPI or 8-bit MCU i/f to the ILI9341. The lack of tech info on items from eBay etc. is why you often need to reverse-engineer them yourself :-( \$\endgroup\$ – SamGibson Jun 26 '17 at 12:15
0
\$\begingroup\$

and the hardware connections at end of the page does not help in how to connect pins to microcontroller.

Why do you say that the schematic at the end of the page doesn't help? It is very clear in my opinion. It shows that the library supports an 8-bit parallel connection between the driver chip and the PIC.

2)How can I connect the pins to PIC controller, I have read the datasheet but I am not able to figure out should I use SPI or 8-bit bus interface and where the pins should be connected.

If you want to use the libaray you are saying, then you have to connect the ILI9341 using an 8-bit parallel interface, meaning there will be an 8-bit data bus and some control signals.

You need to go to Chapter 7.6.3. of the datasheet of ILI9341. There it is very clear how to do this.

\$\endgroup\$
  • \$\begingroup\$ thank you for the answer, when I said that the connections at the end of the page does not help, I mean that they does not help in understanding how to connect ILI9341, but the connections are for different module, also can you tell me what would be better to use MPLAB-X or mikroC for developing on TFT. \$\endgroup\$ – bha159 Jun 24 '17 at 16:58
  • \$\begingroup\$ Well, what do you have in mind when asking this question? Both use C as programming language. So it is totally irrelevant which of them you will use... \$\endgroup\$ – nickagian Jun 24 '17 at 18:01
  • \$\begingroup\$ @nickagain I mean which has more flexibility to code for different types of modules as ILI9341 is not listed in mikroC library page, instead, ILI9340 is listed, so will I be able to use those functions with ILI9341 or should I start with MPLAB and code from scratch or MPLAB has some libraries that I can use. If you can give me some sources you know that will be great, since googling is not giving any reliable and easy sources for beginners. \$\endgroup\$ – bha159 Jun 24 '17 at 19:23
  • \$\begingroup\$ There is no such thing as precompiled libraries specific for MPLAB. What you need to do is find somewhere online a C library to drive the ILI9341 (I mean the actual C code, not precompiled) and use it in the MPLAB environment for compilation. The alternative is of course to write your own code. \$\endgroup\$ – nickagian Jun 24 '17 at 19:51
  • \$\begingroup\$ @nickagain I have this module imgur.com/a/3a72d ,the pins given in this module are different from that given in ILI9341, it does not have IM0, IM1, IM2,IM3 so how should I interface it with PIC. \$\endgroup\$ – bha159 Jun 26 '17 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.