problem with a program

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

Moderators: Benj, Mods

Post Reply
franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

problem with a program

Post 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..

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: problem with a program

Post 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.

franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

Re: problem with a program

Post by franky »

thanks Benj!!!

today I'll check it...

thank you so much!

franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

Re: problem with a program

Post 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!

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem with a program

Post 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.
Martin

franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

Re: problem with a program

Post by franky »

ok i'll check it...
thank you medelec35!
i'll tell you something after the test..

franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

Re: problem with a program

Post 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
Attachments
_TEST DISPLAY.fcf
(21.69 KiB) Downloaded 323 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem with a program

Post 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.
Martin

franky
Posts: 49
Joined: Tue Jan 13, 2009 7:23 pm
Contact:

Re: problem with a program

Post by franky »

ok thank's at all!!

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

Post Reply