Problems in simulator mode

I am very new to programming, so I may be missing something stupid…
We added a simple bit of autonomous code into user_routines_fast.c, and wanted to see what was happening to the values of our variables without actually putting into the RC (as we can’t really get to the robot as often as we’d like - still being worked on quite a bit! :wink: ), so we used the simulator mode explained in section 6.5 of the 2004 Programming Reference Guide (from IFI). We followed all the steps, built it, then ran it, and got this in the Output window (under the MPLAB SIM tab):
Six lines of “UART-W0006: Receive file has no data or failed to attach when UART receive mode enabled.”
Then one line of “CORE-E0001: Stack overflow error occurred at 0x004836”

What does this mean we are doing wrong? (and how can we fix it?)

Thanks a lot!

Addy.

It looks like you are running the Default Code v2.4, so you should have seen:


UART-W0006: Receive file has no data or failed to attach when UART receive mode Enabled.
UART-W0006: Receive file has no data or failed to attach when UART receive mode Enabled.

The most likely culprit is a missing _SIMULATOR compiler flag.
Double check in MPLAB
Project -> Build Options… -> Project
The MPLAB C18 tab.
_SIMULATOR should be listed under Macro Definitions

If it isn’t, make sure the “Use Alternate Settings” box at the bottom is NOT clicked, then add the compiler flag by clicking on “Add…” by the Macro Definitions box and typing _SIMULATOR in the pop-up that appears.

Re-build everything, then try running the debugger again.

After you are through simulating, turn the flag OFF and recompile (build all) before you program your robot.