DsPIC stops running if GLCD is included in the program

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi,

I have tried to connect a 4D GLCD to a DsPIC30F4011 and am unable to get it to work. I have been running it from a PIC18F28K80 with no problems. All connections have been verified. I have created a small program that flashes an LED on the 30F4011 and that works fine. As soon as i connect in the screen and place the initialise routine and a print routine the screen will not work and the LED will not flash either. Attached is a copy of the program.

One other question, with the EB076 component, what is the difference between version 1 and version 2?

Thanks for your help.
Attachments
b.fcfx
(5.74 KiB) Downloaded 370 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

In your program the first component macro which I assume should be the display initialise is blank. This could explain why the display is not working and the program is locking up.

Regarding the EB076 / 4D Touchscreen component question. V1 works with the old uLCD-32PT display whereas V2 works with the new uLCD-32PTU display.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

Whoops i'm not sure what happened there :oops: .I have placed the initialise function at the start of the program now and still have the same result as mentioned above.

Thanks

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

Wondering if you have been able to follow this up any further. If the display is powered up and nothing is sent to it, the 4D Systems splash screen is displayed. With the screen connected and the above program running the screen goes blank, as well as the led not flashing, so something has been sent to the display.

Thanks

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi,

Would really appreciate some help here, have verified all circuit connections, looks like something that is being sent to the display during the initialisation that is not working. I would really like to move forward with what i am working on and this is causing quite a disruption since the display is a major part of the job.

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hello,

Have you done a 1 second flasher test to confirm your baud rates are correct,

http://www.matrixtsl.com/wiki/index.php ... ED_flasher

There is also a High Speed property, have you tried switching this to no to see if that makes any difference.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben

Yes i have incorporated a flasher. When the initialise and display text macros are put in the flasher no longer works. See the attached file above. That one I left the initialise macro out by mistake but with it in the screen dies not work. I have tried switching the baud rate too with no luck. I have checked the display documentation and it mentions if there is serial activity the 4d splash screen will not be displayed. This is the case hence proving the connections between the pic and the display.

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

Which model of 4D screen are you using and please can you post a simple example showing the problem and I will investigate.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I am using an EB076 V1. I have attached the file below. With the display included in the program the LED no longer flashes, with it removed from the code the LED does flash. Thanks
Attachments
b.fcfx
(5.76 KiB) Downloaded 339 times

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I have had a limited amount of success. I have downloaded the latest pmmc file(uLCD-43PT-R44.PmmC) for the display and selected a EB076V2 display in Flowcode using the 16 bit chip. The led flashes now and i can display text on the screen however i am unable to display any images from the sd card using the DisplayImageFromFilePicaso macro.
I have also tried the above on an 8 bit pic with the same results.
Attachments
a.fcfx
(6.38 KiB) Downloaded 361 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

This article might help it talks about the various ways to handle multimedia files.
http://www.matrixtsl.com/article.php?a=649

If your still having problems then let me know and I will investigate, it could be the 4D serial API has changed on the latest firmware but hopefully not.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

Thanks for posting the article on using media files with the 4D display. I have used this type of display numerous times before with 8 bit pics, with no issues at all using images from the SD card in conjunction with graphics composer.

As mentioned above as soon as i have tried to use a 16 bit pic using the EB076 V1 macros and using the R22 Pmmc file for the display, the PIC locks up (see example file above in this post). When using EB076 V2 macros and using the R44 Pmmc files for the display the PIC runs, you can write text etc but you are unable to display any graphics from the SD card. Using the same setup with an 8 bit pic there are no problems, everything is fully functional.
If your still having problems then let me know and I will investigate, it could be the 4D serial API has changed on the latest firmware but hopefully not.
From all the testing i have done i keep coming to the same conclusion, that there is some issue with with the data that the macros are sending to the display or being unable to decipher the incoming data from the display. If you are able to take a look at this that would be appreciated.

Thanks

Zane

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

I'm not sure why this isn't just working.

The 4D graphical LCD component is the exact same code for the PIC and dsPIC devices so I can't see the component being at fault if it is working fine on the PIC hardware.

I've looked at your project and the only thing I have spotted is the clock sped is still set to 19.6608MHz e.g. the crystal speed of our EB006 PIC hardware. Is this correct for your device?

In your configuration settings the "General Code Segment Write Protect" and "Comm Channel Select" options looks wrong or like they don't have a valid setting. I don't think these would cause massive problems but you never know.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

The crystal speed is correct, it matches that of the crystal fitted.
I have downloaded the latest pmmc file(uLCD-43PT-R44.PmmC) for the display and selected a EB076V2 display in Flowcode using the 16 bit chip. The led flashes now and i can display text on the screen however i am unable to display any images from the sd card using the DisplayImageFromFilePicaso macro.
As mentioned above with the R44.pmmc file installed for the display and using the EB076V2 component the display will work with displying text,however no images can be displayed from the SD card. I have used this method on 8 bit pics many times with no issues. If i can display text on the display this proves that the chip and the display are working correctly. If i can display images from the SD card on an 8 bit chip and that works fine and using exactly the same files with a 16 bit chip and it does not could this point to something within the component macro or is there some issue with how the compiler in a 16 bit environment handles this? (I have no experience with this side of things, just a straw to clutch at)

As mentioned above in earlier posts with a R22.pmmc file installed on the display and using the EB076V1 component nothing happens at all.

Do you have any 16 bit chips and an EB076 display where you can try this yourself and see if you are able to get it working? I have tried everything at my disposal and have not been able to progress any further. The only 16 bit deice i have tried this on is a 30f4011. I have 4 of these and get the same result from each of them. Has anyone else used this type of display with a 16 bit chip and been able to make the display fully functional?

Any help would be most appreciated.

Thanks

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I will have a look today with my logic analyser and monitor the data going to and coming from the display when using an 8 and 16 bit chip using the same instructions and let you know the results.

Thanks

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I wish i had looked at using the logic analyser sooner.

Using the EB076V1 component with the R22.Pmmc file for the display i have observed the following.

Using an 8 bit PIC the display functions ok with the baud rate set to high or low.
Using a 16 bit PIC at a high baud rate the display fails to recognise the command.
EB076V1_DsPIC_HighBaud.jpg
EB076V1_DsPIC_HighBaud.jpg (25.57 KiB) Viewed 20379 times
When running at a low baud rate the display would not work. However upon connecting the logic analyser the display would work. The operation of the display seems to work at times and at others not. This problem is not experienced when using the 8 bit PIC. I am not sure why i am getting these issues and whether there could be some possible hardware conflict. Some thing to experiment with.

Using the EB076V2 component with the R44.Pmmc file for the display i have observed the following.

With an 8 bit and 16 bit chip the results are the same
The program being run initialises the chip and the SD card then writes "test" on the screen. After this it is meant to access an image off the SD card and display it on the screen. However when it gets to this stage it sends out a command of 0x406D. This instuction is not a valid instruction. This is the old instruction used in the R22.Pmmc serial graphics controller instruction set using for the EB076V1 component.
With the R44.Pmmc serial interface used for the EB076V2 component, the instructions for displaying images from the SD card are different
EB076V2_DsPIC.jpg
EB076V2_DsPIC.jpg (147.63 KiB) Viewed 20379 times
Here is the link for the instruction set for the EB076V1 component.
http://old.4dsystems.com.au/downloads/S ... -rev11.pdf

Here is the link for the instruction set for the EB076V2 component.
http://www.4dsystems.com.au/productpage ... R_1_20.pdf

The correct Pmmc file for a given display can be found as follows:
For the EB076V1, on the 4D systems website select "products" and then "legacy items" and scroll down to you find your type of display. Select it and under the "downloads" tab the file is located in there.
For the EB076V2, on the 4D systems website go to the "products" and then "micro LCD modules" and look for your display there. Select your type of display and all associated files and documentation for that display is located on that page.

I hope this is some help to you and helps with fixing up the V2 component.

Thanks

Zane

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

Thanks that helps a lot. I'll get on with a fix for you tomorrow.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

As an extra point of interest, the display file R44.Pmmc (used by EB076V2 component) is the latest revision of firmware for these displays. The older version R22.Pmmc(used by EB076V1 component) is for the old serial graphics controller platform that has been superseded by 4D Systems newer serial programming environment. One clear advantage i can see from using the latest version is that it allows you to calibrate the touchscreen so its output is relative to the pixel co-ordinates where the touch occurred. Under the old version with a display resolution of say 480 x 272 i have found that the actual output from the touch screen is not relative to the pixel co-ordinates and this error becomes larger as you move down the display. For example if a touch occurred at x=470 the return value could be x=495. Just makes it easier for writing your code.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hello Zane,

Please can you try this updated component and see how you get on. I've updated the InitialiseCard and DisplayImageFromFilePicaso macros so it should work correctly now.
gLCD_EB076v2_4D.fcpx
(28.23 KiB) Downloaded 296 times

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I have installed the new component but when i compile the program it fails and these are the messages the compiler has issued.

Errors when generating C source code:
b.c : 1 : error : Too many arguments: gLCD_EB076v2_4D1::G4D_DisplayImageFromFilePicaso
b.c : 2126 : error : Too many arguments: gLCD_EB076v2_4D1::G4D_DisplayImageFromFilePicaso

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hello Zane,

You need to edit the component macros for DisplayImageFromFile as the parameters have had to change.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

Thanks for getting that sorted, it is all working ok now.

With the component macro, you can no longer place multiple images under one file and access them via the offset created in graphics composer, is there any chance of having that facility put back in? Having a look at data sheet are the images displayed through the "display image (FAT)" command, pg110? If so it mentions-
Display an image from the file stream at screen location specified by x, y (top leftcorner). If there is more than 1 image in the file, it can be accessed with the “File Seek”command
If this is achievable that would be fantastic.

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hello,

Right here is another update with the 32-bit file offset address to allow multiple images in a resource file.
gLCD_EB076v2_4D.fcpx
(28.37 KiB) Downloaded 287 times
Let me know how you get on.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Zane »

Hi Ben,

I have tried out the latest version of this component. With the offset set to zero for the high and low positions the image is displayed ok. If the program continues to cycle through the image is displayed 17 times and on the 18th time the image is no longer displayed, just a blank screen. The word "test" continues to be displayed on each loop and the screen is cleared as well at the end.
If i try to display an image with an offset, the image is not displayed and the display resets itself so the 4D splash screen is shown.
I have tried deleting the component and all the macros associated with it and then started off fresh. This has made no difference either. I have attached a copy of the program for your reference.

Thanks for your patience with this.
Attachments
b.fcfx
(6.45 KiB) Downloaded 247 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DsPIC stops running if GLCD is included in the program

Post by Benj »

Hi Zane,

I'm away from my desk for a couple of weeks now but I will get back onto this problem for you ASAP when I'm back. Sorry for the delay.

If you could investigate what's going on with the comms again then that would probably help a lot to determine what's going wrong.

Post Reply