Pacal Pro 4.0 Update changed disiplay colors

General discussion on mikroPascal PRO for PIC32.
Post Reply
Author
Message
Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Pacal Pro 4.0 Update changed disiplay colors

#1 Post by Rotary_Ed » 16 Nov 2017 17:31

Thanks to Lana's assistance, my program now compiles correctly with update 4.0 to the Pascal PRO compiler - with one exception.

All of my display colors changed :cry: . Colors WHITE and BLACK have exchanged places, BLUE is now YELLOW, etc. Since it was only a display problem, I concluded that the problem must lie in the TFT library. So I cut out the compiler 4.0 TFT library from the USES folder and copies those same files from my compiler 3.6.0 USES file into the compiler 4.0 USES folder library and that fixed the problem.

I use the TFT TFT_Init_ILI9341_8bit() function for my display. It works correctly using old TFT library inserted into the 4.0 Uses Library, but changes color using the new 4.0 TFT Library files.

Aha, I said -- there must be a difference in the TFT Definition file between the two versions, so I used MS WORD to compare the two files, but I could not find any differences in the TFT DEF source code between the two versions.

So moving the old TFT files to the new 4.0 compiler library "fixed" my color problem. But, I clearly do not know why the difference.

I thought I would mention it in case someone else had the same "color" problem and knew what the problem was. :D
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Pacal Pro 4.0 Update changed disiplay colors

#2 Post by lana.arsic » 17 Nov 2017 19:07

Hi,

I'm sorry, I couldn't reproduce the same behavior,
I have tried to change many colors on EasyTFT with ILI9341
in mikroPascal PRO for PIC32, v 4.0.0 and all colors were displayed correctly.

Can you please send me image of your display?
Can you please send your code in a zip/rar archive?

Kind regards,
Lana

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#3 Post by Rotary_Ed » 18 Nov 2017 00:44

Hi Lana,

Part of the problem may be that the TFT Library does not have a display with the type of display controller my display uses. It turns out the ILI9341 comes the closest to the controller on my display. Now that I think about it(its been awhile ago), I had to manually "adjust" the binary color code for each color to get what I wanted on my display.

So I must confess the color display problem is very likely of my own making and not a fault with the compiler. I just did not understand why an update in compiler would make a difference to what worked previoulsy.

My apologies.

Attached is my code if you want to play with it.

Since I have already replace the 4.0 TFT files with the TFT files from my version 3.6. 0 - I can no longer produce the code which gave the incorrect color display and therefore can not provide an image.
Attachments
EIC3201L 15 Nov 2017 KSWB W1P4.zip
(3.31 MiB) Downloaded 109 times
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#4 Post by Rotary_Ed » 18 Nov 2017 15:21

Hi Lana,

Attached are two images of the display of my project. The screen with the blue background color is how it should be and is with compiler 3.6.0. The display with the yellow background is the exact same code but using the 4.0 compiler.

As I mentioned, if I copy the TFT files from the Uses library of 3.6.0 to the uses library of 4.0 then compiler 4.0 produces the same blue background display.

However, that said, a more serious problem is now my UART comm function no longer communicates. It does in 3.6.0 but not in 4.0, I don't know if anyone else has reported this problem.

If anyone is using the UART modules for a PIC32MX759F512L chip and have it working, I would appreciate knowing.

Thanks
DSC01436.JPG
DSC01436.JPG (97.2 KiB) Viewed 4129 times
DSC01435.JPG
DSC01435.JPG (104.99 KiB) Viewed 4129 times
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed display colors - FIXED

#5 Post by Rotary_Ed » 20 Nov 2017 16:43

I found a solution for my previously mentioned color problem using compiler 4.0.

I do not know why, but when I changed the type Display controller I use for my display the colors in 4.0 became what they should.
The compiler does not have a display controller type exactly like the one my display uses. So I had been using

Code: Select all

 TFT_Init_ILI9341_8bit(320,240); //(320, 240);
Which has worked fine up until compiler 4.0

Experimenting around I tried a variation of that display controller type using

Code: Select all

 TFT_Init_ILI9340_8bit(320,240); //(320, 240);
This change from an IL9341 to an IL9340 solved that problem. :D

Ed
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Pacal Pro 4.0 Update changed disiplay colors

#6 Post by lana.arsic » 20 Nov 2017 18:27

Hi Ed,

I'm glad that you have solved the issue with colors.

Regarding UART, I have tested on EasyPIC Fusion v7
with PIC32MX795F512L and it was working properly,
can you please try project from the attachment?

Kind regards,
Lana
Attachments
USB UARTA.zip
(30.34 KiB) Downloaded 112 times

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#7 Post by Rotary_Ed » 21 Nov 2017 15:31

Hi Lana,

Could not get your code to work on my easyPIC Fusion V7 board - did set the SW12 so UART signal could get to PIC32795F512L pins, but nothing came up on display. I suspect the display (which only shows white) is not initialized properly - will work on that and see if I get the UART data displayed.

However, I did get my UART code to work with version 4.0 . Here is what I found:

The problem I am having apparently resides in the module's advanced initialization routines. Posting this in case someone may be having a similar problem.

Here is the code I use for UART2 and UART5 modules for over two years that works with all Pascal Pro PIC32compilers up to and including compiler 3.6.0. However, this advanced initialization does not work for my project with compiler 4.0. There is no error indication when compiled - just does not work.

Code: Select all

 
UART2_Init_Advanced(9600,24000 ,_UART_LOW_SPEED, _UART_8BIT_NOPARITY, _UART_ONE_STOPBIT);   // 11 July 2015    
UART_Set_Active(@UART2_Read, @UART2_Write, @UART2_Data_Ready, @UART2_Tx_Idle); // set UART2 active

UART5_Init_Advanced(9600,24000 ,_UART_LOW_SPEED, _UART_8BIT_NOPARITY, _UART_ONE_STOPBIT);  // 11 July 2015
UART_Set_Active(@UART5_Read, @UART5_Write, @UART5_Data_Ready, @UART5_Tx_Idle); // set UART5 active
  
 



After some experimenting I tried this simple initialization


Code: Select all


 UART2_Init(9600);   // 20 Nov 2017

 UART5_Init(9600);   // 20 Nov 2017

This initialization makes my UART code work in compiler version 4.0 :D .

I can not determine why my original code initialization works with 3.6.0 but not 4.0. But, it looks like the simpler UART initialization routine works for me in 4.0, so onward! :)

Thanks, again

_________________
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Pacal Pro 4.0 Update changed disiplay colors

#8 Post by lana.arsic » 24 Nov 2017 19:25

Hi,

Example which I have sent you was only for UART,
not for TFT since you have said that you solve the issue with display.

Regarding UART_Init_Advanced function,
I have tested and it was working properly in version 4.0.0.

But I will test Set_Active routines with two UARTs
and let you know about the results.

Kind regards,
Lana

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#9 Post by Rotary_Ed » 25 Nov 2017 15:10

Hi Lana,

Understand about the UART test program not being for the TFT problem. However, when I loaded it to my easyPic Fusion V7 the text being sent as UART test data was never displayed. That is why I assumed the problem might be I did not have the display properly initialized.


Yes, please let me know your results with the Set_Active routine. I had used both the UART_Initi_Advanced and the Set_Active routines on all versions of Pascal Pro PIC32. But, the combination did not work for me on 4.0 - however, I found that using the simpler UART_Init did work.

Thanks
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Pacal Pro 4.0 Update changed disiplay colors

#10 Post by lana.arsic » 27 Nov 2017 18:51

Hi,

The first code should send back data which you sent through UART Terminal,
can you please just in case check if you choose appropriate COM port?

Can you please send me image of your board?

I have also tested UART2 and UART5 with UARTx_Init_Advanced and
Set_Active routines and they both work properly, can you please try code from the attachment?

Kind regards,
Lana
Attachments
USB UARTA.zip
(31.06 KiB) Downloaded 104 times

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#11 Post by Rotary_Ed » 28 Nov 2017 15:29

Hi Lana,

Ok, I find that I can not check out the UART code you sent as I am lacking a Type A to Type A Male USB cable. I presume I am to use the USB-UARTA or USB-UARTB port on the Fusion V7 board to my compiler's UART terminal.

I have ordered the needed cable and should have it in with a couple of days. Will get back to you then.
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: Pacal Pro 4.0 Update changed disiplay colors

#12 Post by Rotary_Ed » 01 Dec 2017 15:58

Hi Lana,

Tested the UART code you sent compiled with 4.0 and loaded to my Fusion V7 board. Both channels USB-UART worked, two way communication over both UART2 and UART5 chip modules :D . Since your code used the advanced initialization and worked, I conclude the problem has to be in my code :? . So thanks, I will keep working on my code to find out where the problem lies.

Thanks again
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

Post Reply

Return to “mikroPascal PRO for PIC32 General”