|
|
View previous topic :: View next topic |
Author |
Message |
sandrini
Joined: 11 Oct 2007 Posts: 12
|
Code made in version 4.114 does not work in version 5. |
Posted: Tue Aug 26, 2014 4:54 am |
|
|
Dear Sirs,
I have a problem in my PCWHD compiler version 5.026. The below code compile without errors, but when I program my microcontroller, many messages are not showed in display.
This code was made in my older PCWHD compiler version 4.114 and when I compile with this version and program the microcontroller, the messages are all showed in display.
Please somebody would know inform what it is happening?
Thank you.
Code: |
#include<18F4520.h>
#use delay (clock=8000000)
#fuses HS, NOWDT, PUT, BROWNOUT, NOLVP
#use RS232 (Baud=9600, xmit = PIN_C6, rcv = PIN_C7)
#include "LCD4B.c"
char msg_string_info1_por[] = " MENSAGEM 01 ";
char msg_string_info1_eng[] = " MENSAGEM 02 ";
char msg_string_info2[] = " MENSAGEM 03 ";
char msg_string_info3[] = " MENSAGEM 04 ";
char msg_string_info10_por[] = " MENSAGEM 06 ";
char msg_string_info20_por[] = " MENSAGEM 07 ";
....
....
..... //I have over 59 messages
void main()
{
lcd_ini();
printf(lcd_escreve,"\f %s\n", msg_string_info1_por);
delay_ms(1000);
printf(lcd_escreve,"\f %s\n", msg_string_info1_eng);
delay_ms(1000);
printf(lcd_escreve,"\f %s\n", msg_string_info2);
delay_ms(1000);
printf(lcd_escreve,"\f %s\n", msg_string_info3);
delay_ms(1000);
printf(lcd_escreve,"\f %s\n", msg_string_info10_por);
delay_ms(1000);
printf(lcd_escreve,"\f %s\n" ,msg_string_info20_por);
delay_ms(1000);
....
....
.... //I have over 59 messages (printf)
while (true);
} |
Last edited by sandrini on Tue Aug 26, 2014 1:47 pm; edited 2 times in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 26, 2014 1:14 pm |
|
|
If you can post a test program that we can compile on our PC, then we
could look at your problem.
Try to make a test program with the smallest possible number of
messages, that shows the problem. Try to make us a test program
that has less than 59 messages, if possible. |
|
|
sandrini
Joined: 11 Oct 2007 Posts: 12
|
|
Posted: Tue Aug 26, 2014 1:51 pm |
|
|
Dear PCM programmer,
I made a program with 20 messages and again, in version 5.026, I have a problem... the messages does not appear in the LCD from the message 6.
But in version 4.114 all the messages are showed.
Thank you
Code: |
#include<18F4520.h>
#use delay (clock=8000000)
#fuses HS, NOWDT, PUT, BROWNOUT, NOLVP
#use RS232 (Baud=9600, xmit = PIN_C6, rcv = PIN_C7)
#include "LCD4B.c"
char msg_string_info10_por[] = " MENSAGEM 001 ";
char msg_string_info20_por[] = " MENSAGEM 002 ";
char msg_string_info30_por[] = " MENSAGEM 003 ";
char msg_string_info40_por[] = " MENSAGEM 004 ";
char msg_string_info50_por[] = " MENSAGEM 005 ";
char msg_string_info60_por[] = " MENSAGEM 006 ";
char msg_string_info70_por[] = " MENSAGEM 007 ";
char msg_string_info80_por[] = " MENSAGEM 008 ";
char msg_string_info90_por[] = " MENSAGEM 009 ";
char msg_string_info100_por[] = " MENSAGEM 010 ";
char msg_string_info110_por[] = " MENSAGEM 011 ";
char msg_string_info120_por[] = " MENSAGEM 012 ";
char msg_string_info130_por[] = " MENSAGEM 013 ";
char msg_string_info140_por[] = " MENSAGEM 014 ";
char msg_string_info150_por[] = " MENSAGEM 015 ";
char msg_string_info160_por[] = " MENSAGEM 016 ";
char msg_string_info170_por[] = " MENSAGEM 017 ";
char msg_string_info180_por[] = " MENSAGEM 018 ";
char msg_string_info190_por[] = " MENSAGEM 019 ";
char msg_string_info200_por[] = " MENSAGEM 020 ";
void main()
{
lcd_ini();
printf(lcd_escreve,"\f%s", msg_string_info10_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s", msg_string_info20_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s",msg_string_info30_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info40_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info50_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info60_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info70_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info80_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info90_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info100_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info110_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info120_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info130_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info140_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info150_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info160_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info170_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info180_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info190_por);
delay_ms(1000);
printf(lcd_escreve,"\f%s" ,msg_string_info200_por);
while (true);
} |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 26, 2014 2:09 pm |
|
|
I ran it in MPLAB simulator and I did get a problem. It only displayed the
first 5 messages. But, when I edited the message declarations so they
are declared as 'const', then it worked. It displayed all 20 messages.
Edit your file so all messsages are declared as 'const'. Example:
Quote: | char const msg_string_info10_por[] = " MENSAGEM 001 ";
char const msg_string_info20_por[] = " MENSAGEM 002 ";
char const msg_string_info30_por[] = " MENSAGEM 003 ";
.
.
.
etc. |
|
|
|
sandrini
Joined: 11 Oct 2007 Posts: 12
|
|
Posted: Wed Aug 27, 2014 6:24 am |
|
|
Thank you PCM,
My program works now. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|