View previous topic :: View next topic |
Author |
Message |
starfire151
Joined: 01 Apr 2007 Posts: 195
|
Is anybody using a 480x320 TFT with a PIC? |
Posted: Thu Oct 12, 2023 4:32 pm |
|
|
Is there anyone using a graphics display (i.e. 480x320 TFT, like HX8357) with a PIC microcontroller?
If so, is there a library posted?
Thanks. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Thu Oct 12, 2023 5:10 pm |
|
|
Many years ago I used an FTDI EVE chip (probably the FT801) mated to a dsPIC with a *lot* of memory to interface to an RGB 320 x 240 display w/ capacitive overlay for touch detection. I've never tried mating a PIC directly to an RGB display.
The EVE chip had bugs but the end result wasn't too bad. Honestly, use something like an STM32 or the like - bite the bullet and learn a new toolchain because PICs aren't really meant to drive an RGB display. |
|
|
Jerson
Joined: 31 Jul 2009 Posts: 125 Location: Bombay, India
|
|
Posted: Thu Oct 12, 2023 8:24 pm |
|
|
If you're referring to an arduino TFT shield type display, they can be used with a 8 bit data bus. As far as I know, there is no ready library that you will find other than the ones written for arduino. You need to customise that to communicate with the TFT. Again, in the same form factor, there are many drivers that are on the TFT, not just the HX you mention.
Another point you should note, the amount of pixels to transfer (480x320) and doing it in code makes it very slow to refresh the TFT. You may not get more than 1 or 2 FPS doing a screen wipe. That is something you should consider if it matters to your project.
An easier option to consider would be a touch screen HMI like global.dwin.com or nextion which takes away the burden to drawing the screen and you just communicate with the HMI via serial UART. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Oct 13, 2023 5:45 am |
|
|
Since no CCS C driver or library exists, simply translate the ardunio version. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Oct 13, 2023 6:12 am |
|
|
The big problem is RAM.
If you are doing anything at all complex with a display, you end up having
to hold copies of a lot of the display RAM in the processor. Most PIC's do
not have enough RAM to do this. I have quite large graphic LCD's with
touchscreens on several systems, but the larger ones are all on DsPIC;s
not smaller chips.
The compiler does come with a complete graphic library for a display,
to give basic lines, circles text etc., without using too much RAM.
The example for this is EX_GLCD.c, and this is supplied to work with
a HDM64G12 controller. It can be adapted for others.
You will almost certainly find that 98% of PIC's will not have enough
RAM to use the Arduino libraries. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Fri Oct 13, 2023 6:16 am |
|
|
Just google PIC TFT and you will find quite a bit.
In addition to the CCS version, there are at least two Github PIC-TFT projects
ut there which are fairly easy to translate. There is also a Mikroe driver I
converted initially that worked fairly well then I added a touch controller. I
had to eventually move to a 120MHZ DsPIC to get half decent response times
on a 4" TFT. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
starfire151
Joined: 01 Apr 2007 Posts: 195
|
|
Posted: Fri Oct 13, 2023 8:30 am |
|
|
Thanks to all who responded! Great info!
Yeah, I kinda figured RAM would be the major stumbling block. I was thinking of using an external FRAM (like the FM25V10, 128K x 8) but I think the interface between the PIC, the FRAM, and the TFT would be way too slow for any practical use. I'm using a Teensy 4.0 with an Adafruit HX8357 right now in the Arduino environment and it works quite well. The Teensy 4.0 runs at 600MHz and has a lot of RAM and other functions. It's kind of a power hog, though. That's why I was looking at downsizing to a PIC.
If it works, don't fix it...
Thanks again. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Sat Oct 14, 2023 7:21 am |
|
|
Remember, there are 'smart' graphic LCD's, where you can just send
basic commands like the text screens. You then don't have to hold the
screen in your processor memory.
Historically these were expensive, but there are a surprising number now
at reasonable prices. You can get SPI and synchronous serial units.
Lot's of the OLED's offer this, and quite a few other displays also support
it. |
|
|
starfire151
Joined: 01 Apr 2007 Posts: 195
|
|
Posted: Sun Oct 15, 2023 6:12 am |
|
|
Do you have some model numbers of some smart displays you've used or you know there's libraries for?
I've used the Nextion NX4832T035 before with an Arduino project. I was thinking of trying to use it with a PIC, since it uses a simple serial interface. Do you know of any that have a I2C or SPI interface?
Thanks, again. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Oct 15, 2023 6:28 am |
|
|
use google '480x320 tft' and you'll get a million hits...
most under $75, one ( PI ) is only $12 US !!! for a 3.5" screen.
Only you can decide which unit to buy, based upon availability, cost, features, etc.
In the 'dinodayze' I interfaced an 8 bit IDE VGA video card to the 'new' 16F877.sigh.....been a few changes since then.....
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Oct 16, 2023 4:51 am |
|
|
'480x320 tft' hits you get here are not the 'smart LCD' hits that you need
for the units with built in smart controllers.
Look for 'intelligent' or 'smart tft' for units with these controllers.
I've used the EVE3 and EVE4 controllers, but these are for much larger
screens (1280*760). |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Dec 18, 2023 12:03 pm |
|
|
Sorry I'm late to replying to this..
There used to be (haven't looked lately) PIC24 family micros that have RGB display capabilities built into the hardware. I don't know if microchip still makes them. They have buffer memory and can do the refresh rates for driving about the size display you mention.
I've hooked PIC18F's to an RGB OLED display (128x128) for something - but that used an onboard controller (SED1339 IIRC) and I essentially grafted some of Microchip's PLIB drivers into CCS to write the code that runs on the PIC.
So - writing to a controller based display is also always an option. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Tue Dec 19, 2023 6:13 am |
|
|
These are the 24F DA family. They don't support normal full RGB, but a
256 maximum colour palette from a look-up table, which you program.
Normal max 480x272. So smaller than was being asked about.
You can go larger at lower frame rates though. |
|
|
|