ICD-2 Problems

Started by Fredrik Krook December 20, 2003
Hi!

Im trying to program a circuit... 16F877 and then run it in debugmode...
But it doesnt work... getting the errors listed below...

Does anyone know how to get it to work... Programming Target...
...Erasing Part
...Programming EEPROM Memory
...Programming Program Memory (0x0 - 0x1EFF)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
...Programming User IDs
Verifying...
...Program Memory
...EEPROM
...User ID Memory
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
ICD0154: Invalid target mode for requested operation (TM = Running)
ICD0083: Target not in debug mode, unable to perform operation
MPLAB ICD 2 Ready



Are you using MPASM or Wiz C? (this group focuses on
Wiz C). Do you have the config fuses set?

I have a simple program to turn on 1 led when a switch
on port A, bit 4 is pushed. I found that it gave me
one of your messages when I commented out the lines
that set the config fuses (I got:
ICD0083: Target not in debug mode, unable to perform
operation
ICD0069: Unable to run target)

Try this program and see if you can get it to work. It
works with my ICD2 and PICDEM2 board.

;----------------
title "ledon - Turn on a LED when a Button is
Pressed"
;
; The Program simply sets up Bit 0 of Port "A" to
Output and then
; Sets it Low when RA0 is pulled low.
;
; Hardware Notes:
; _MCLR is tied through a 4.7K Resistor to Vcc and
PWRT is Enabled
; A 220 Ohm Resistor and LED is attached to PORTB.0
and Vcc
; A 10K pull up is connected to RA0 and it's state
is passed to
; RB0
;
; Myke Predko
; 99.12.03
;
; Modified July 10'02 by MZ for '452 use on PICDEM2
; User presses S2, the switch connected to RA0 and
the RB0 LED
; turns on.

list pf877 ifdef __16F84
INCLUDE "p16f84.inc"
endif
ifdef __16F877
INCLUDE "p16f877.inc"
endif
ifdef __18F452
INCLUDE "p18f452.inc"
endif

; Registers

ifdef __16F84
__CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON
else
__CONFIG _CP_OFF & _DEBUG_OFF & _HS_OSC & _PWRTE_ON
& _WDT_OFF & _LVP_OFF & _WRT_ENABLE_ON & _BODEN_ON &
_CPD_OFF
endif PAGE
; Mainline of ledon

; org 0

nop ; "nop" is Required
for Emulators

clrf PORTB ;Clear PORTB
bsf STATUS, RP0 ; Goto Bank 1 to set Port
Direction
clrf TRISB ;PORTB all outputs
bcf STATUS, RP0 ; Go back to Bank 0 movlw 0x00
movwf PORTB ; turn off any LED's

; bsf STATUS, RP0 ; Goto Bank 1 to set
Port Direction
; bcf TRISB ^ 0x080, 0 ; Set RB0 to Output
; bcf STATUS, RP0 ; Go back to Bank 0

Loop
clrf PORTB ; turn off LEDs
btfsc PORTA, 4 ; Test PORTA.4 for
switch
goto Loop
movlw 1 ; prepare to set bit for LED
movwf PORTB ; move it to PORTB.0 if pushed

goto Loop end
;---------------
--- Fredrik Krook <> wrote:
> Hi!
>
> Im trying to program a circuit... 16F877 and then
> run it in debugmode...
> But it doesnt work... getting the errors listed
> below...
>
> Does anyone know how to get it to work... > Programming Target...
> ...Erasing Part
> ...Programming EEPROM Memory
> ...Programming Program Memory (0x0 - 0x1EFF)
> ...Loading DebugExecutive
> ...Programming DebugExecutive
> ...Programming Debug Vector
> ...Programming User IDs
> Verifying...
> ...Program Memory
> ...EEPROM
> ...User ID Memory
> ...Debug Executive
> ...Debug Vector
> ...Verify Succeeded
> Programming Configuration Bits
> .. Config Memory
> Verifying configuration memory...
> ...Verify Succeeded
> Connecting to debug executive
> ICD0154: Invalid target mode for requested operation
> (TM = Running)
> ICD0083: Target not in debug mode, unable to perform
> operation
> MPLAB ICD 2 Ready >



--- In , Mike Zdancewicz <mazdance@y...> wrote:
> ...(this group focuses on
> Wiz C). Do you have the config fuses set?


really? all this time I though it was about PICs. my bad...

Phil



No, I'm wrong. Sorry. (I subscribe to the Wiz C group
and got confused.)

Nevermind.

--- Phil <> wrote:
> --- In , Mike Zdancewicz
> <mazdance@y...> wrote:
> > ...(this group focuses on
> > Wiz C). Do you have the config fuses set? > really? all this time I though it was about PICs.
> my bad...
>
> Phil




Hi! MPLAB & MPASM... C is over kill for me right now...

The preogram works just fine standalone... But it wont go into debug mode...
Im using a lab-board that is some of kind of a clone for a PICDEMO board...
Using 16F877... With that PIC i t dont work.. but ive tried a 16F877A and
it workt just fine in debugmode... ???

When im using the onboard ICD then it works in debugmode... But not with
the 16F877A (the firmware on the ICD is not upgraded to work with A PICS...

So i know that the program works and my hardware is ok... but cant put the
16F877 i debug mode...

Checked the conf. bits... and they are as they should...

Regards
Fredrik
----- Original Message -----
From: "Mike Zdancewicz" <>
To: <>
Sent: Sunday, December 21, 2003 3:04 AM
Subject: Re: [piclist] ICD-2 Problems > Are you using MPASM or Wiz C? (this group focuses on
> Wiz C). Do you have the config fuses set?
>
> I have a simple program to turn on 1 led when a switch
> on port A, bit 4 is pushed. I found that it gave me
> one of your messages when I commented out the lines
> that set the config fuses (I got:
> ICD0083: Target not in debug mode, unable to perform
> operation
> ICD0069: Unable to run target)
>
> Try this program and see if you can get it to work. It
> works with my ICD2 and PICDEM2 board.
>
> ;----------------
> title "ledon - Turn on a LED when a Button is
> Pressed"
> ;
> ; The Program simply sets up Bit 0 of Port "A" to
> Output and then
> ; Sets it Low when RA0 is pulled low.
> ;
> ; Hardware Notes:
> ; _MCLR is tied through a 4.7K Resistor to Vcc and
> PWRT is Enabled
> ; A 220 Ohm Resistor and LED is attached to PORTB.0
> and Vcc
> ; A 10K pull up is connected to RA0 and it's state
> is passed to
> ; RB0
> ;
> ; Myke Predko
> ; 99.12.03
> ;
> ; Modified July 10'02 by MZ for '452 use on PICDEM2
> ; User presses S2, the switch connected to RA0 and
> the RB0 LED
> ; turns on.
>
> list pf877 > ifdef __16F84
> INCLUDE "p16f84.inc"
> endif
> ifdef __16F877
> INCLUDE "p16f877.inc"
> endif
> ifdef __18F452
> INCLUDE "p18f452.inc"
> endif
>
> ; Registers
>
> ifdef __16F84
> __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON
> else
> __CONFIG _CP_OFF & _DEBUG_OFF & _HS_OSC & _PWRTE_ON
> & _WDT_OFF & _LVP_OFF & _WRT_ENABLE_ON & _BODEN_ON &
> _CPD_OFF
> endif > PAGE
> ; Mainline of ledon
>
> ; org 0
>
> nop ; "nop" is Required
> for Emulators
>
> clrf PORTB ;Clear PORTB
> bsf STATUS, RP0 ; Goto Bank 1 to set Port
> Direction
> clrf TRISB ;PORTB all outputs
> bcf STATUS, RP0 ; Go back to Bank 0 > movlw 0x00
> movwf PORTB ; turn off any LED's
>
> ; bsf STATUS, RP0 ; Goto Bank 1 to set
> Port Direction
> ; bcf TRISB ^ 0x080, 0 ; Set RB0 to Output
> ; bcf STATUS, RP0 ; Go back to Bank 0
>
> Loop
> clrf PORTB ; turn off LEDs
> btfsc PORTA, 4 ; Test PORTA.4 for
> switch
> goto Loop
> movlw 1 ; prepare to set bit for LED
> movwf PORTB ; move it to PORTB.0 if pushed
>
> goto Loop > end
> ;---------------
> --- Fredrik Krook <> wrote:
> > Hi!
> >
> > Im trying to program a circuit... 16F877 and then
> > run it in debugmode...
> > But it doesnt work... getting the errors listed
> > below...
> >
> > Does anyone know how to get it to work...
> >
> >
> > Programming Target...
> > ...Erasing Part
> > ...Programming EEPROM Memory
> > ...Programming Program Memory (0x0 - 0x1EFF)
> > ...Loading DebugExecutive
> > ...Programming DebugExecutive
> > ...Programming Debug Vector
> > ...Programming User IDs
> > Verifying...
> > ...Program Memory
> > ...EEPROM
> > ...User ID Memory
> > ...Debug Executive
> > ...Debug Vector
> > ...Verify Succeeded
> > Programming Configuration Bits
> > .. Config Memory
> > Verifying configuration memory...
> > ...Verify Succeeded
> > Connecting to debug executive
> > ICD0154: Invalid target mode for requested operation
> > (TM = Running)
> > ICD0083: Target not in debug mode, unable to perform
> > operation
> > MPLAB ICD 2 Ready
> >
> >
> >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions