Problem LCD component (Solved)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Problem LCD component (Solved)

Post by Crenwick »

Hi all,

I'm starting a beautiful project for my fish-tank where I want to program some light transitions of RGB stripes with a DS3231 RTC and an LCD to monitor the whole thing :)

When I test the LCD it's ok but when I add the RGB-led component (with the "tick" included in an interrupt) then the LCD is completely scrambled !

Simulation run's fine.

I tested on FC5 and it works. Am I doing something wrong or is there a problem in one of the two components ?

I added my test code.
Attachments
RGB.fcfx
(19.11 KiB) Downloaded 242 times
Last edited by Crenwick on Mon May 19, 2014 3:06 pm, edited 2 times in total.
Bernard

Flowcode 6 / EB006-V9

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem between RGBled and LCD component

Post by Crenwick »

Hello,

I did some comparisons between the c code output of the FCV5 and the FCV6 and all seems ok.
When I test the lcd module it's fine and when I test the RGBled module also. Only when I try to use the two on the same chart it goes wrong.

So I have a question about the delays ... Should it be possible that the FCI_DELAYBYTE_xx has some influence from the timer0 interrupt ?

I'm almost sure the problem comes from the lcd component (if lcd-macros interrupted then display goes wrong).


Regards,
Bernard

Flowcode 6 / EB006-V9

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem between RGBled and LCD component

Post by LeighM »

Hi
It does seem strange that you are seeing a difference between V5 and V6.
I’ve had a quick look and cannot yet see what the issue might be.
But a couple of ideas:
Attempting to update the LCD display every 10mS might be producing strange results.
It might be worth adding in an extra variable counter that increments in the loop, then put your LCD update code in an “if counter > 100” branch, and also reset the counter to zero.
That way your LCD will only update every second.
If that does not fix the problem, then try disabling the interrupt at the start of the LCD code and then re-enable it at the end, just to see if the interrupt is the problem.
Hope that helps
Leigh

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem between RGBled and LCD component

Post by Crenwick »

I tried a lower refresh with no success, when I disable the interrupt then the lcd works but the led output flashes (period of display is way to long for led update)
Bernard

Flowcode 6 / EB006-V9

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem between RGBled and LCD component

Post by LeighM »

OK, thanks for the update. As you said, looks like it is an interrupt problem then.
I'll try and dig deeper.

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem between RGBled and LCD component

Post by Crenwick »

I looked in the forums and found in FCV5 a mod made by Ben in the LCD component to change the ports to latches, I'm unable to check if this mod has also be done in the FCV6 component because since FCV6 components are now in .fcpx format and no more editable :(

Can you have a look ?

Here is the post : http://www.matrixmultimedia.com/mmforum ... 5&start=25

Changed also title :wink:
Bernard

Flowcode 6 / EB006-V9

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem LCD component

Post by Crenwick »

@ Matrix Staff

Can you please check this component ? I'm blocked in my project due to this problem.

Sorry for the stress, I suppose you're all busy or maybe some colleagues are out of office :wink:
Bernard

Flowcode 6 / EB006-V9

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem LCD component

Post by LeighM »

Hi
Yes, sorry, we are a bit short staffed at the moment, holiday season :D
I’ve had another quick look and found that we have the same issue with a 16F1937 that does have the LAT instruction and is used by V6 LCD component (unlike 887)
I’ll see if I can get any further with the issue
Regards,
Leigh

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem LCD component

Post by LeighM »

Hi

I've found the bug.
Please use the attached file for now (drop it into your ..\CAL\PIC folder)
(Still needs further work as a previous bug fix caused this issue, so I need to now fix the other bug :wink:

Leigh
Attachments
PIC_CAL_IO.h
(8.03 KiB) Downloaded 249 times

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem LCD component

Post by Crenwick »

Hi Leigh,

That's perfect ! Works now fine :)
Bernard

Flowcode 6 / EB006-V9

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem LCD component

Post by LeighM »

Very good :)
Attached is the latest, now with both fixes :)
Attachments
PIC_CAL_IO.h
(8.11 KiB) Downloaded 230 times

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: Problem LCD component

Post by Crenwick »

Done !

Problem solved.

Just a question, what was the other problem/fix ?
Bernard

Flowcode 6 / EB006-V9

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Problem LCD component (Solved)

Post by LeighM »

There was a problem with the expansion of the following Flowcode statement, it would not work on target (due to compiler optimisation).

Code: Select all

$PORTB = NOT $PORTB

Post Reply