TFT Library unpredictable results

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
Henk van Beek
Posts: 97
Joined: 11 Mar 2005 11:14
Location: Breda, The Netherlands

TFT Library unpredictable results

#1 Post by Henk van Beek » 25 Oct 2014 14:41

I'm using mE pascal compiler 6.4.0 with mikrobootloader on a PIC18F25K20.
I wanted to use "Usage of ILI9341 SPI with TFT library" out of Libstock contributed by Rares Dorin Porutiu.

After altering the I/O to meet PIC requirements,
I succeeded with TFT_Init_ILI9341_8bit_Custom_SPI,
TFT_Fillscreen and TFT_Write_Text.and TFT_Dot and TFT_Line.

But when I add or TFT_H_Line or TFT_Rectangle or TFT_Circle
the program keeps restarting before displaying anything.

For me it is not possible debugging TFT_Lib without sources.

My both sources goes hereby.

In file "TFT_Display.mpas" when I comment out line "TFT_H_Line" all works fine.

Could one please shine a light.
Attachments
TFT_Problem_Sources.zip
(8.78 KiB) Downloaded 151 times
What God wants, God gets.

kentar
Posts: 78
Joined: 29 Oct 2010 07:54

Re: TFT Library unpredictable results

#2 Post by kentar » 16 Apr 2015 18:36

(Outdated answer :)
I had same problems too.
When i inserted
TFT_Set_Default_Mode();
right after initialization routine
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV16, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
All problems solved.
In any case its better to set pen ( and brush probably) before draw lines on screen.
Best speed results with pic at 64Mhz (PLL 4x16Mhz) and spi at div16
These cheap ili9341 tfts are better than I expected
Image

Post Reply

Return to “mikroPascal PRO for PIC General”