Page 1 of 1

problem with a program

Posted: Thu Jul 22, 2010 1:59 pm
by franky
hi at all!,


i have a problem when i compile a program.. i have these warnings..

"Warning unreferenced functions removed:

FCD_LCDDisplay0_GetDefines in: D:\_LABORATORIO\_MOTO ACQUA\_CENTRALINA MOTO ACQUA\_CENTRALINA MASTER REV_4 1KHz22072010.c

FCD_LCDDisplay0_PrintASCII in: D:\_LABORATORIO\_MOTO ACQUA\_CENTRALINA MOTO ACQUA\_CENTRALINA MASTER REV_4 1KHz22072010.c

FCD_LCDDisplay0_Command in: D:\_LABORATORIO\_MOTO ACQUA\_CENTRALINA MOTO ACQUA\_CENTRALINA MASTER REV_4 1KHz22072010.c

FCD_LCDDisplay0_RawSend in: D:\_LABORATORIO\_MOTO ACQUA\_CENTRALINA MOTO ACQUA\_CENTRALINA MASTER REV_4 1KHz22072010.c

LCD_722908_Dummy_Function in: D:\_LABORATORIO\_MOTO ACQUA\_CENTRALINA MOTO ACQUA\_CENTRALINA MASTER REV_4 1KHz22072010.c



Building CASM file

Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_Cursor' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)

Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_PrintString' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)

Serious Warning: Possible sw stack corruption, function 'LCD_722908_RawSend' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)"


and so when i try to start the ecio40 the display goes wrong, flash whit a lot of strange simbols..

Re: problem with a program

Posted: Thu Jul 22, 2010 4:33 pm
by Benj
Hello,
"Warning unreferenced functions removed:
This means that the functions that you are not calling (referencing) in your program will not be included in the assembled hex file. Basically because your not using them they wont consume memory on the device. This is normal and one of the major advantages of using the C language.
Serious Warning: Possible sw stack corruption
This is where a function is called from the main program loop and then again from an interrupt routine. This can lead to problems like you are mentioning where the display gets corrupted with strange symbols. Instead of using LCD functions in your interrupt macro you can instead set a flag variable in the interrupt routine. Then in your main loop check the variable and if it has been set than do your LCD functionality before clearing the variable again.

Hope this makes sense.

Re: problem with a program

Posted: Fri Jul 23, 2010 5:52 am
by franky
thanks Benj!!!

today I'll check it...

thank you so much!

Re: problem with a program

Posted: Sat Jul 24, 2010 7:48 am
by franky
hi Benj,

I have tried but when I go up to 100Hz the display print a lot of strange characters...

have you got some ideas?

thank you so much!

Re: problem with a program

Posted: Sat Jul 24, 2010 9:15 am
by medelec35
Hello franky.
This is usually caused by timing issues. E.g Chip clock speed could be set differently to actual osc speed of hardware.
I.e If you have a 8.0MHz crystal connected to microcontroller, then make sure you manually type in a clock speed of 8000000.
Could you have missed or added an extra 0 for instance.
place a small delay at the beginning of your program e.g 50ms to allow LCD warm up time.

Or in your case could still be a conflicting macro.

If you don't mind sharing your program, then upload it, and some one will look at it for you.

Re: problem with a program

Posted: Sun Jul 25, 2010 8:43 am
by franky
ok i'll check it...
thank you medelec35!
i'll tell you something after the test..

Re: problem with a program

Posted: Wed Jul 28, 2010 12:31 pm
by franky
hi Benj,
I have tried a lot but i can't resolve the problem... the display goes wrong... probably because a write a lot of data at the same moment.. i don't know.. can you help me?

please find the enclosed file..

thank you so much

Re: problem with a program

Posted: Wed Jul 28, 2010 3:41 pm
by medelec35
I believe the reason for corrupt LCD is you have LCD components in you interrupt macro, and in your main program. What will happen is whilst writing to LCD in main, your interrupt is probably triggered, overwriting the LCD, hence corrupt characters.
Best way is never write to LCD within an interrupt.
Within interrupt, just set a variable to 1.
Then in main use decision branch if variable = 1 then write to LCD. Variable = 0 .

When you compile code, look out for warnings like:
  • Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_Cursor' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
See if you can resolve them.
I am just repeating some of what Ben said after looking at your program, as I totaly agree with him.

If you get stuck with this, I’m sure some can assist you further.

Re: problem with a program

Posted: Thu Jul 29, 2010 11:05 am
by franky
ok thank's at all!!

i'll try to solve like you told me.. and i'll tell you something.