Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) LCD function not displaying (Read 15342 times)
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
LCD function not displaying
Jan 28th, 2014 at 11:22am
Print Post  
My project is menu driven via the LCD.

I have a small useful function for writing to LCD (still using LiquidCrystal.h).
When using the debugger the LCD displays the first few lines of code (randoml qty)

When compiling without debugging or when using the arduino IDE, or using the standard LiquidCrystal.h commands the display is normal. 

I'd like to use the breakpoints to help me, but I've no idea which part of the menu I'm in as the display is blank.

I'd prefer not to have to re-code the whole thing.

What can I do? 
« Last Edit: Jan 29th, 2014 at 9:54pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #1 - Jan 28th, 2014 at 3:31pm
Print Post  
Hi,

The debugger uses arduino Serial.print statements by default. These are well tried and tested so I would appreciate a look at your project. This should show some confusion or something different that hasn't been explained properly, we will amend the wiki if required. 

Please zip and email your sketch along with any sub folder to info [at] visualmicro.com

Thanks
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #2 - Jan 29th, 2014 at 10:38pm
Print Post  
Hi,

Thanks for sending the sketch. I forgot to ask that you first upload with breakpoints that fail then close atmel, save the sketch then zip and email.

Please try to include the solution.

Thanks
  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #3 - Jan 31st, 2014 at 10:37am
Print Post  
Hi,

While attempting to include the solution Presumably .atsln) I find my files all over the place, from me attempting to make backups.

I would like to start a new project and include my 12 .ino files. (Arduino called them tabs)

Whatever I've tried brings the files into the solution, but when compiling I have errors that "xxxx" was not declared in this scope.

Please point me to an article that will guide me.

Possibly this has some bearing on the original problem, although that compiled fine.

Thanks for your patience
Don
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #4 - Jan 31st, 2014 at 2:25pm
Print Post  
Don, I am having difficulty understanding what you are doing or what the problem is.

You have control over where the .asln is saved so I recommend saving it in the sketch folder with the sketch files. Then all is in one place.

When you open a sketch Visual Micro should add the 12 files (tabs) automatically.

Please zip and email your sketch to info [at] visualmicro.com.

Also please email an image of your ide

Thanks
  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #5 - Jan 31st, 2014 at 2:38pm
Print Post  
Tim,

Totally my fault I'd renamed the extra files starting with numbers.

I now have a new project and need to ponder on it before sending it to you.

I'll report back 

Thanks Don


  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #6 - Jan 31st, 2014 at 3:10pm
Print Post  
Phew  Cheesy
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #7 - Feb 5th, 2014 at 1:35pm
Print Post  
Hi Don,

I have had a look at your sketch and I think this might be a problem in the code however there are some things to consider and look at.. 

1) Please run your arduino in a clean instance of Atmel without a project open. Open the serial monitor and you will see the unprocessed RAW serial messages that the debugger is sending. You will see your string being sent in breakpoint #1 (if my memory is correct). Please confirm that the string appears empty after some use and also when it does start to appear empty please confirm if you see any corrupted serial data or values immediately prior to that

2) Your writeLCD(int intLine, String strMsg) function expects a String to be passed to it. I see your call ends with a constant string but I have no idea if the string you are passing is terminated with a null (/0) or if the Arduino is loosing the null termination. Anyway I can only assume that this is the problem and can't think if much else that would cause a debug packet to be correct but a string expression value to be wrong.

Code
Select All
			writeLCD(0, tempArray[0] + tempArray[1] + tempArray[2] + tempArray[3] + tempArray[4] + tempArray[5] + tempArray[6] + tempArray[7] + tempArray[8] + " H:M:S");
			writeLCD(1," Saved! - wait");
			lcd.noBlink();
			FSM = 0;									// returns keyboard to normal
			delay(2000);
 



3) Interested to know what happens if you move the breakpoint up a few lines so that it is away from the lcd.print function.

Summary

The reason for these assumptions is that Visual Micro debugger just uses Serial.print() which is a well tried and tested Arduino function.

I look forward to some test results.
  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #8 - Feb 5th, 2014 at 2:49pm
Print Post  
Hi Tim,

Not sure of what you mean by:

Please run your arduino in a clean instance of Atmel without a project open.?

With no project there's no code & I cannot upload anything to the Arduino
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #9 - Feb 5th, 2014 at 3:17pm
Print Post  
Hi Don,

Sorry my request assumed that you have already uploaded your code with debugging. 

Thanks
« Last Edit: Feb 5th, 2014 at 3:21pm by Tim@Visual Micro »  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #10 - Feb 5th, 2014 at 6:04pm
Print Post  
Hi Tim,

This is what I received from the serial monitor. 

Port no longer available
Port open
VMDPV_1|1_VMDPV
Found 1 devices.
Found device 0 with address: 
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE
VMDPE_2|_VMDPE

Each button press adds a line or two, but no hint of the debugging messages.

Can I force a (/0) termination? If so how.

I suspect a memory problem and will try a smaller sketch shortly to identify if that is correct or not.

This was done with the breakpoint a couple of lines up, no change the LCD is blank from the start now.

I really hope we can sort this out soon, or I'll need to go back to the traditional Serial.print.

Thanks Don
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #11 - Feb 5th, 2014 at 6:36pm
Print Post  
Hi Don,

Breakpoint 1 is not even being sent or hit or we would have seen it in the output. Breakpoint 1 is in the writeLCD() function.

Breakpoint 2 is shown in your trace extract and will be empty because the breakpoint is in your clearLCD() function and you have set it not to show a value. I notice that breakpoint 2 is also in a function that expects the caller to have allocated a global temp variable but I am sure you have that catered for.

Breakpoint 3 is positioned so that it only fires if (keyPad == "down")

You can switch on "tools>options>compiler>show build folder" where you will see the .cpp file that is actually compiled. You will see in this file that a serial.print() sends any watched variables such as strMsg for breakpoint #1

As I have said it is a simple system, I haven't heard of the lcd functions causing a clash with serial so maybe you should use serial print(strMsg) and see what happens.

Because we are using standard Arduino functions it's more likely that something is overwriting some Arduino memory. maybe temp being used before it has been populated or maybe a null value in one of the dtostrf conversions. Obviously you have a big sketch with a lot going on so I can't really look at it in a reasonable time frame.

One question I have is what does the lcd do if it is passed an empty string. Does it leave the previous values on the screen.

Maybe try adding break points before the writeLCD is called allowing you to individually report what is in each tempArray[n]

Code
Select All
writeLCD(1, tempArray[0] + tempArray[1] + tempArray[2] + tempArray[3] + tempArray[4] + tempArray[5] + tempArray[6] + char(223) + "C") 



One good test would be to remove the breakpoint in the write and replace with serial.println(strMsg)

if you persist with the debugger I suggest watching the youtube tutorial on the debugger page. It might show a few things about the trace window that will help you see what is or is not happening.
« Last Edit: Feb 5th, 2014 at 6:40pm by Tim@Visual Micro »  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #12 - Feb 6th, 2014 at 12:22pm
Print Post  
Breakthrough I hope Shocked

I reduced the size of the sketch enormously and there's no problem with the display now.

Hopefully that was the problem, the new problem of course is to make it all fit back into the available memory.

Thanks for your time and trouble, most appreciated.
Don
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #13 - Feb 6th, 2014 at 12:39pm
Print Post  
Good thanks for the update, I hope it was that. If your sketch allocated memory dynamically then the Arduino can run out of memory but it normally just crashes.

I noticed a lot of strings in your code, obviously when working with a big LCD project this can't always be helped but maybe switch some of the constants from string to numeric such as "down" but removing serial.print(" some text ") and replacing with breakpoints can make a big difference. 

Obviously this is chiken and egg because people have to first be confident with the debugger and saving breakpoints (which are stored in the solution .asln and not with the project .cppproj.

Best of luck
  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #14 - Feb 18th, 2014 at 9:42am
Print Post  
Hi Tim,

I installed an extension "MarginOfError" which highlights every occurence of writeLCD() with "sketch error" message.

I cannot see any error and hoped you might spot it. (maybe a reserved word?)

Whatever it is, it may be the cause of the LCD display problem.

void writeLCD(byte intLine, String strMsg)
{
     lcd.setCursor(0,intLine);
     lcd.print("                ");
     lcd.setCursor(0,intLine);
     lcd.print(strMsg);
}

Thanks Don
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12203
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LCD function not displaying
Reply #15 - Feb 18th, 2014 at 1:47pm
Print Post  
It might be that the extension isn't navigating the libraries correctly.

What is in intLine and what data type is it defined as?

Might be worth emailing the [sketchname].cpp from the build folder after debug upload. Then at least we can confirm what serial statements are being used by the debugger and which variables are being reported.

If you also have time to rezip your project and email it with a link to this post we can try to test it for you. If you have non-standard libs then please zip them or provide download links

Thanks
  
Back to top
IP Logged
 
don
Newbies
*
Offline


Posts: 9
Location: S Africa
Joined: Jan 27th, 2014
Re: LCD function not displaying
Reply #16 - Feb 18th, 2014 at 5:41pm
Print Post  
I tried retyping one line and the margin error has disappeared,
unfortunately I couldn't find an option to show non-printing characters.

Seems to be a glitch in one of the characters

Will let you know if the problem reoccurs. Hopefully it was a simple one Smiley

void writeLCD(byte intLine, String strMsg)
{
     lcd.setCursor(0,intLine);
     lcd.print("                ");
     lcd.setCursor(0,intLine);
     //lcd.print(strMsg);
     lcd.print(strMsg);
}

Thanks again for your time & trouble,
Regards Don
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint