2004/04/25 23:42:40
Guest
Hello

I am pretty new to C18, but have used MPLab SIM and ICD2 with assembler.

I finally got my first C prog to compile and I am in the process of debugging it.

My problem is this, as I single-step through the program the position indicated by the GreenArrow in the C file seems to lag significantly behind what instruction is actually being processed by the simulator, as indicated by a GreenArrow in the DisassemblyListing.

Is this common, or is there something I have to setup/initialise to 'sync' the position indicators in the files?

Thanks in advance
Tim
2004/05/08 22:51:46
Guest
Just a follow up, I sent the same query to Tech Support at Microchip and had the folling reply.



Are you using multiline macros? If so, there is an open preprocessor bug
that causes source line numbering to be offset. The workaround is to use
the line-continuation character on each line within the macro call.

Example:
#pragma romdata CONFIG
_CONFIG_DECL (_OSCS_OFF_1H & _OSC_HS_1H, \
_PWRT_ON_2L & _BOR_ON_2L & _BORV_45_2L, \
_WDT_OFF_2H & _WDTPS_128_2H, \
_CCP2MUX_ON_3H, \
_STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L, \
_CP0_OFF_5L & _CP1_OFF_5L, \
_CPB_OFF_5H & _CPD_OFF_5H, \
_WRT0_OFF_6L & _WRT1_OFF_6L, \
_WPC_OFF_6H & _WPB_OFF_6H & _WPD_OFF_6H, \
_EBTR0_OFF_7L & _EBTR1_OFF_7L, \
_EBTRB_OFF_7H);
#pragma romdata // Back to default sections for variables and constants

[End Quote]


This fixed my problem. Thanks Tech Support.

Tim
© 2017 APG vNext Commercial Version 4.5

Use My Existing Forum Account