Page 1 of 1

Problem LCD component (Solved)

Posted: Tue May 13, 2014 11:23 am
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.

Re: Problem between RGBled and LCD component

Posted: Wed May 14, 2014 8:26 am
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,

Re: Problem between RGBled and LCD component

Posted: Wed May 14, 2014 11:09 am
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

Re: Problem between RGBled and LCD component

Posted: Wed May 14, 2014 11:36 am
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)

Re: Problem between RGBled and LCD component

Posted: Wed May 14, 2014 12:04 pm
by LeighM
OK, thanks for the update. As you said, looks like it is an interrupt problem then.
I'll try and dig deeper.

Re: Problem between RGBled and LCD component

Posted: Wed May 14, 2014 4:40 pm
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:

Re: Problem LCD component

Posted: Mon May 19, 2014 7:53 am
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:

Re: Problem LCD component

Posted: Mon May 19, 2014 11:23 am
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

Re: Problem LCD component

Posted: Mon May 19, 2014 1:14 pm
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

Re: Problem LCD component

Posted: Mon May 19, 2014 1:58 pm
by Crenwick
Hi Leigh,

That's perfect ! Works now fine :)

Re: Problem LCD component

Posted: Mon May 19, 2014 2:29 pm
by LeighM
Very good :)
Attached is the latest, now with both fixes :)

Re: Problem LCD component

Posted: Mon May 19, 2014 3:05 pm
by Crenwick
Done !

Problem solved.

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

Re: Problem LCD component (Solved)

Posted: Mon May 19, 2014 3:33 pm
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