Flowcode corrupt?
Posted: Fri Apr 03, 2009 11:52 am
Am having problems with Flowcode in last few days and am being to wonder if my installation is corrupt or Windows XP has done some update that is conflicting with it. Probably more likely my faulty programming though. At all times the simulation is correct.
I have changed the PIC and LCD to see if it’s a hardware fault and it makes no difference.
Symptoms include
1) When running a simple test loop that should display the time and clock up seconds, minutes and hours it starts OK but then displays random corrupt characters at times instead of numbers, e.g. hours might cycle through 23, 23, L8, 23, <8, 4, 23 and some non English characters/symbols I can’t replicate here. The variables are correct as they always go back to displaying the correct values after the corruption.
2) On another version of programme the hex file is not found, see error message below, even though, when I select the β€Compile to HEX’ option there is no error message.
Is the
Serious Warning: Possible sw stack corruption, function '__div_16_16' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
below a problem? All the other warnings are standard ones that do not seem to upset any of the various versions of the programme.
A problem could be that I am running a cut down version of the full programme in order to get the timing loop right before correcting it in the main programme. There are lots of remnants of the full code there that could be upsetting the timing loop, but as it works on the simulation it's difficult to see what these upsets might be.
Another problem that is probably not related is that this interrupt TMRO Overflow driven timing loop (it counts up to about 900 so that makes one minute at my low clock speed and prescaler; 15Hz interrupt frequency ) worked accurately on an 16F886. But on the 16F2520 the timing is very very slow.
Error message:-
Building CASM file
Serious Warning: Possible sw stack corruption, function '__div_16_16' 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 'FCD_LCDDisplay0_Clear' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
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 'FCM_Set_variables' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_PrintNumber' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCM_Reset_buttons_to_off' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCM_Button_time_loop' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'delay_s' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Memory Usage Report
===================
RAM available:1536 bytes, used:261 bytes (17.0%), free:1275 bytes (83.0%),
Heap size:1275 bytes, Heap max single alloc:127 bytes
ROM available:32768 bytes, used:16882 bytes (51.6%), free:15886 bytes (48.4%)
success
.............
Return code = 0
Launching the programmer...
C:\Program Files\Microchip\PICkit 2 v2\PK2CMD_MTX\pk2cmd_mtx.exe -PPIC18F2520 -F255B57~1.hex -M -A3.6 -H
Hex file not found.
.........
Return code = 37
Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.
FINISHED
I have changed the PIC and LCD to see if it’s a hardware fault and it makes no difference.
Symptoms include
1) When running a simple test loop that should display the time and clock up seconds, minutes and hours it starts OK but then displays random corrupt characters at times instead of numbers, e.g. hours might cycle through 23, 23, L8, 23, <8, 4, 23 and some non English characters/symbols I can’t replicate here. The variables are correct as they always go back to displaying the correct values after the corruption.
2) On another version of programme the hex file is not found, see error message below, even though, when I select the β€Compile to HEX’ option there is no error message.
Is the
Serious Warning: Possible sw stack corruption, function '__div_16_16' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
below a problem? All the other warnings are standard ones that do not seem to upset any of the various versions of the programme.
A problem could be that I am running a cut down version of the full programme in order to get the timing loop right before correcting it in the main programme. There are lots of remnants of the full code there that could be upsetting the timing loop, but as it works on the simulation it's difficult to see what these upsets might be.
Another problem that is probably not related is that this interrupt TMRO Overflow driven timing loop (it counts up to about 900 so that makes one minute at my low clock speed and prescaler; 15Hz interrupt frequency ) worked accurately on an 16F886. But on the 16F2520 the timing is very very slow.
Error message:-
Building CASM file
Serious Warning: Possible sw stack corruption, function '__div_16_16' 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 'FCD_LCDDisplay0_Clear' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
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 'FCM_Set_variables' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_PrintNumber' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCM_Reset_buttons_to_off' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCM_Button_time_loop' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'delay_s' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Memory Usage Report
===================
RAM available:1536 bytes, used:261 bytes (17.0%), free:1275 bytes (83.0%),
Heap size:1275 bytes, Heap max single alloc:127 bytes
ROM available:32768 bytes, used:16882 bytes (51.6%), free:15886 bytes (48.4%)
success
.............
Return code = 0
Launching the programmer...
C:\Program Files\Microchip\PICkit 2 v2\PK2CMD_MTX\pk2cmd_mtx.exe -PPIC18F2520 -F255B57~1.hex -M -A3.6 -H
Hex file not found.
.........
Return code = 37
Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.
FINISHED