| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| mancio76 
 
 
 Joined: 10 Aug 2011
 Posts: 8
 Location: Italia
 
 
			    
 
 | 
			
				| Debugging problem |  
				|  Posted: Wed Aug 10, 2011 6:22 am |   |  
				| 
 |  
				| Hello to everyone. 
 I'm working with PIC16F88 and MPLAB 8.73
 CCS compiler version 4.103
 I use ICD to program and debug the code.
 
 When I compile and download the code on chip, the system works greatly.
 But I also would like to enter in debug mode to analyze the workflow.
 
 But the MPLAB can't do this!
 
 The code I've wrote is this:
 
  	  | Code: |  	  | #include <16F88.h>
 #device *=16
 #device ICD=TRUE
 #device adc=8
 
 #FUSES NOWDT                    //No Watch Dog Timer
 #FUSES INTRC                    //Internal RC Osc
 #FUSES PUT                      //Power Up Timer
 #FUSES MCLR                     //Master Clear pin enabled
 #FUSES BROWNOUT                 //Reset when brownout detected
 #FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
 #FUSES NOCPD                    //No EE protection
 #FUSES NOWRT                    //Program memory not write protected
 #FUSES DEBUG                    //Debug mode for use with ICD
 #FUSES NOPROTECT                //Code not protected from reading
 #FUSES FCMEN                    //Fail-safe clock monitor enabled
 #FUSES IESO                     //Internal External Switch Over mode enabled
 #FUSES RESERVED                 //Used to set the reserved FUSE bits
 #FUSES CCPB3               //CCP1 input/output multiplexed with RB0
 
 #use delay(clock=8000000,RESTART_WDT)
 
 | 
 When connecting the ICD to the chip for the debug, the MPLAB window tell me the following:
 
 Connecting to MPLAB ICD 2
 ...Connected
 Setting Vdd source to target
 Target Device PIC16F88 found, revision = Rev 0x8
 ...Reading ICD Product ID
 Running ICD Self Test
 ...Passed
 MPLAB ICD 2 ready for next operation
 Programming Target...
 ...Validating configuration fields
 ...Erasing Part
 ...Programming Program Memory (0x0 - 0x57)
 ...Loading DebugExecutive
 ...Programming DebugExecutive
 ...Programming Debug Vector
 Verifying...
 ...Program Memory
 ...Debug Executive
 ...Debug Vector
 ...Verify Succeeded
 Programming Configuration Bits
 .. Config Memory
 Verifying configuration memory...
 ...Verify Succeeded
 Connecting to debug executive
 ICD0083: Debug:  Unable to enter debug mode.  Please double click this message for more information.
 MPLAB ICD 2 ready for next operation
 
 Is there anyone can tell me where is the problem?
 
 Thank you in advance.
 |  | 
	
		|  | 
	
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Aug 10, 2011 10:16 am |   |  
				| 
 |  
				| Look in the MPLAB Help file for the ICD2. 
 1. In MPLAB, go to the Help / Topics menu. In the Debuggers section,
 select "MPLAB ICD 2".
 
 2. In the pop-up window for ICD 2 Help, go to the Search tab and
 search for this:  Top reasons
 
 3. It will show you this result:  General Debug Failure Actions
 Click on that one and read this section:
 
 Top Reasons Why You Can't Debug
 |  | 
	
		|  | 
	
		| mancio76 
 
 
 Joined: 10 Aug 2011
 Posts: 8
 Location: Italia
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Thu Aug 11, 2011 9:34 am |   |  
				| 
 |  
				| Many thanks for the help. Finally I can enter in debug mode!
 
 But to do that, I've use an external crystal as clock source.
 Seems that the PIC16F88 can't work in debug mode using internal oscillator.
 
 Is correct this?
 
 If someone can answer to the question, can be an opportunity to understand something more about the PIC16F88.
 
 I've read some times the data sheet of the PIC16F88 but I've not noticed something about internal oscillator and debug mode.
 |  | 
	
		|  | 
	
		|  |