Problems using PIC32 C compiler and VisualGLCD

General discussion on Visual GLCD Software.
Post Reply
Author
Message
estradajae
Posts: 41
Joined: 26 Jan 2010 06:10

Problems using PIC32 C compiler and VisualGLCD

#1 Post by estradajae » 31 Jan 2012 05:02

Hi

It seems to be that I'm from the few that are currently using a PIC32 with the visual GLCD...

I have been working for the last year with visual GLCD, visual TFT and so on, and I feel comfortable using them, and I have been using them succesfully, with some mino issues like the problems that happen when you want to change the caption of a button mainly during the program, and if you want to mix text with numbers and so on...

It happened that for my application a PIC18 was insufficient, in terms of RAM and ROM, (I was using a SmartGLCD) so I decided to use a freshly designed control board for a GLCD screen virtually Identical to the used in the smartglcd board (with the RA6963 controller and so on)... but with a PIC32mx340f512H (if I recall correctly now...) and also I included a micro sd slot and so on...so far so good...

I decided to go that way for obvious reasons (more ram, rom and storage space) and also as now VisualGLCD now supports PIC32 then I proceded...

First I noticed on the visualGLCD project settings that you could assign ANY data pin of the GLCD to any i/o pin of the MCU (thats great...it helps with pcb routing a lot!)...but at first I thought it's great, and all the other pins listed on the project settings look normal...

Unfortunately...after I ordered the pcbs...received them...soldered and so on (and made the programmer recognize the mcu)...I started working on the firmware (modding my current project to fit it to the pic32...), but first, I decided to start a test program from scratch to see if the system works...BUT then I started to realize the following:

If you select a PIC18 on the project settings, you will see a pinout list that actually corresponds to the pinout of the RA6963C based GLCDs, BUT if you select a PIC32, the pin definitions do not actually match the pins of the GLCD!

but assume you wired it right...(I thought that the cs lines named there were a typo..and I thought it was fs1 and fs2...) and then generate the code and you go to the MikroC for PIC32 compiler and you try to compile and then you find the following:

1. If you don't use the touch screen option and you "uncheck it" on visual GLCD, the visualGLCD STILL generates the code for it with todo's on the pins, thresholds and calibration constants...and then you get the annoying bit definitions for the ADC lines and so on..EACH TIME YOU GENERATE THE CODE! a workaround I've made is just to fill it with any values and some free pins on the mcu and be able to get rid of the compilation error or commenting/deleting this lines manually on the code.
2. The compiler arises a long list of errors associated to the pin definitions of the GLCD...it says it can't find the Data port, the WR, CS, reset and so on lines.

Too bad since it seems that you guys at ME made a great job making the visualGLCD more versatile making it possible to assign any pin of the GLCD to any pin on the MCU (which I did) but you did not modify the T6963C libraries to fit this new feature! and obviously it makes IMPOSSIBLE to use the announced feature of VisualGLCD compatible with PIC32 compiler...which is obviously NOT compatible... With this problem, I just lost more than 20 hours of work, the project shall now wait I don't know how much time, and it should have been just a couple of hours migrating the code from a PIC18 to a PIC32...

I bed you pardon If I'm definately wrong with my statements...what I'm telling you is what just happened this afternoon to me while working, and right now I don't have the screenshots..but I think the problem is easily reproduced just by creating a project with a PIC32 and then filling the desired configuration...and then trying to compile it on the mikroc pro for pic32 compiler.

Tomorrow I can get the screenshots for the issues related.


Thank you

Jorge

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Problems using PIC32 C compiler and VisualGLCD

#2 Post by janko.kaljevic » 31 Jan 2012 11:42

Hello,

I apologize for inconvenience.

We will fix this as soon as possible.
Thanks for reporting.

If you encounter any issue with this project, please feel free to contact us and we will be glad to help you with it.

Best regards.

estradajae
Posts: 41
Joined: 26 Jan 2010 06:10

Re: Problems using PIC32 C compiler and VisualGLCD

#3 Post by estradajae » 01 Feb 2012 22:49

Thank you very much for your answer.

We hope that the update comes as soon as possible...and that you keep the feature of assigning any MCU pin to any GLCD pin..we have invested time and money on our project to find out that the VisualGLCD and PIC32 do not works as it is stated on your website...since sometimes we design our hardware according to your software...

Best regards,

Jorge

sovary
Posts: 7
Joined: 16 Aug 2010 11:36
Location: Iran

Re: Problems using PIC32 C compiler and VisualGLCD

#4 Post by sovary » 02 Feb 2012 17:57

Hi Jorge,
I detect this problem several month ago, about the release date of VGLCD Ver. 2.5
I have a project as same as you with PIC32 and 240x128 Glcd. without touch panel and all object are in control with 4 push button and 1 rotary encoder. the project is a front panel for inverter welding machine (TIG AC/DC).
anyway! for solving your problem and going ahead with your project I attached a modified file of 'Visual GLCD' that created by me that solved my problem with this tool.

download the attach file and extract it, the file name is 'Controllers.xml' then copy and replace it with the file at this address:
"C:\Users\Public\Documents\Mikroelektronika\Visual GLCD\Board Defs"

Or

if you installed your software in another location, just right click on your Visual GLCD's icon and choose 'Open file Location' then double click on 'Board Defs' folder and you can find 'Controllers.Xml' file. just replace with downloaded file.

Now I think you can enjoy of developing your project with PIC32 !

Good Luck!

Shervin
Attachments
Controllers.zip
(2.56 KiB) Downloaded 315 times

estradajae
Posts: 41
Joined: 26 Jan 2010 06:10

Re: Problems using PIC32 C compiler and VisualGLCD

#5 Post by estradajae » 03 Feb 2012 22:56

Thank you very much!

Tomorrow I will make the test and see if it works!!

Great work!

estradajae
Posts: 41
Joined: 26 Jan 2010 06:10

Re: Problems using PIC32 C compiler and VisualGLCD

#6 Post by estradajae » 03 Feb 2012 23:49

It seems to work very well!

But unfortunately...I will have to change the PCB since it only works when you use a unique port for the data lines...and at first you could use any pin to any data line...

It is a far better option being able to choose any pin to any data line since it gives you a great flexibility when you design a PCB...

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Problems using PIC32 C compiler and VisualGLCD

#7 Post by janni » 04 Feb 2012 02:52

estradajae wrote:It is a far better option being able to choose any pin to any data line since it gives you a great flexibility when you design a PCB...
I doubt it anybody will ever write a GLCD library with freely presetable data lines. The flexibility you desire would lead to several tens of times lower performance. This is PIC32, no single instructions to set/clear a port bit :( .

sovary
Posts: 7
Joined: 16 Aug 2010 11:36
Location: Iran

Re: Problems using PIC32 C compiler and VisualGLCD

#8 Post by sovary » 04 Feb 2012 23:15

estradajae wrote:It seems to work very well!
Hi Jorge,
Glad to hear it worked well! :)
estradajae wrote:But unfortunately...I will have to change the PCB since it only works when you use a unique port for the data lines...and at first you could use any pin to any data line...

It is a far better option being able to choose any pin to any data line since it gives you a great flexibility when you design a PCB...
About this issue I have an idea, I think there's a way to assign each data pins of glcd to any I/O pins of PIC32 and maybe you do not have need to modify your PCB :!: but didn't tested by myself yet.

Please do the following:

1-Assume that we need a Universal PORT (in this example, 8-bit and named 'UniPORT')
that is able to assign any I/O pins of PIC32 to its bits (Like this: UniPort0_bit = LATB0_bit, UniPort1_bit = LATE4_bit, UniPort2_bit = LATD1_bit, ... , UniPort7_bit = LATC5_bit)
That red words depends on your board connections, I typed them here random!

2-The artificial port must define as an SFR because mE define 'T6963C_dataport' as an 'extern sfr unsigned long' and since predefined SFR's start from the address 0xBF800000 to address0xBF8861EC (look at your MCU definition file in your compiler (C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC32\defs)); and the Peripherals space is 1Mb (start from address 0xBF800000 to address 0xBF8FFFFF in virtual address (look at "PIC32MX Family Reference Manual, Sect. 03 Memory Organization - Table 3-2: PIC32MX Address Map")), So I think Our artificial port (UniPORT) can take palce at this address0xBF8861F0 as first line at the below code example.

3-Now we can assign each I/O Pins of PIC32 that are related to GLCD's data pins, to 'UniPORT' with '#define' directive.
Remember that UniPORT's Bits is equivalent to GLCD's data bits; for example: UniPORT0_bit <--> GLCD_DATA0_bit and if GLCD_DATA0_bit is connected to LATD3_bit, then LATD3_bit should be define to UniPORT3_bit.

Jorge, try this code example and change the pin with your own board configuration and inform me about the result please :)
@mE Guy's: Confirm my idea, is it possible?

Code: Select all

sfr char UniPORT absolute 0xBF8861F0;

#define UniPORT0_bit LATB3_bit
#define UniPORT1_bit LATD0_bit
#define UniPORT2_bit LATD5_bit
#define UniPORT3_bit LATC5_bit
#define UniPORT4_bit LATB2_bit
#define UniPORT5_bit LATE7_bit
#define UniPORT6_bit LATC1_bit
#define UniPORT7_bit LATE4_bit

// T6963C module connections
char T6963C_dataPort at UniPORT;
sbit T6963C_ctrlwr at LATE2_bit;
sbit T6963C_ctrlrd at LATE1_bit;
sbit T6963C_ctrlcd at LATE0_bit;
sbit T6963C_ctrlrst at LATE4_bit;
sbit T6963C_ctrlce at LATE3_bit;
sbit T6963C_ctrlfs at LATE5_bit;
sbit T6963C_ctrlmd at LATE6_bit;
sbit T6963C_ctrlwr_Direction at TRISE2_bit;
sbit T6963C_ctrlrd_Direction at TRISE1_bit;
sbit T6963C_ctrlcd_Direction at TRISE0_bit;
sbit T6963C_ctrlrst_Direction at TRISE4_bit;
sbit T6963C_ctrlce_Direction at TRISE3_bit;
sbit T6963C_ctrlfs_Direction at TRISE5_bit;
sbit T6963C_ctrlmd_Direction at TRISE6_bit;
// End T6963C module connections
Good Luck!

Shervin

strud
Posts: 77
Joined: 12 Jun 2009 04:24

Re: Problems using PIC32 C compiler and VisualGLCD

#9 Post by strud » 16 Jan 2016 22:46

Shervin,

This is a nice idea and I would like to make use of it if anyone has had success.

Did anyone try this workaround ?

Strud

Post Reply

Return to “Visual GLCD General”