PDA

View Full Version : MCS+ ICD stops for no apparent reason?



jellis00
- 21st March 2010, 06:30
I am using MCS+ and its ICD to compile/run a PBP v2.6 program on an 18F4550 that is installed in an EasyPic6 development board.
The ICD compile works OK and the burn of the program to the chip is OK. I have a PAUSE 10 statement at the start of the program so I can step from there in the ICD. My applicable code excerpt is posted below.
Everything works OK as I step through the statements until I get to the TRISE = 0 statement. At that point the ICD stops and displays an ICD error message box saying that it can't proceed because there is an ICD Address Mismatch ("microcontroller is communicating different address information from those contained in the debug files").
I tried reprogramming a couple of times and get the same results.
Can anyone tell me how to fix this?



Pause 10 ' This statement is placed at beginning of code for ICD run
' -----[ Device Declaration ]---------------------------------------------
;--- if you un-comment these, you must comment the ones in the .inc file--
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM

Include "Modedefs.Bas"
DEFINE OSC 16
' Initialize Hardware
' ===================
'Set registers
'OSCCON.7 = 0 ' Clear IDLEN bit to allow SLEEP mode
' According to data sheet, must clear CONFIG2H.0 (WDTEN bit)
' in order to use WDTCON. Not clear from Data sheet how to reach
' WDTEN bit with config fuses??
'WDTCON.0 = 1 ' Set SWDTEN bit to turn on WDT
'WDTCON = %00010110 ' Turn WDT off to SLEEP indefinitely.
TRISA = 0 ' PORTA all outputs for LCD use
TRISB =%00001100 ' RB2 & RB3 set as RTC Alarm1 & Alarm2 inputs
TRISC = 0
TRISD = 0
TRISE = 0 ' ICD MESSAGE ERROR OCURRS HERE!
INCLUDE "DT_INTS-18.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ' Include if using PBP high priority interrupts
INCLUDE "ALLDIGITAL.pbp" ' Sets all registers for digital ops.
INCLUDE "Average_Single.inc"

DEFINE I2C_SLOW 1 ' Set i2c to the standard speed
DEFINE I2C_HOLD 1 ' Enable recieving i2c device to pause communication