Kashan, Have you figured out the reason? You may want to give PICkit 2 and its programmer-to-go (PTG)=A0a try. Once you set it up, you can always program PIC chips without a PC. Here is=A0a step by step tutorial on programmer-to-go (PTG)=A0: http://www.auelectronics.com/UserManual-PICKit2ProgrammerToGo.htm =A0Funny N. Au Group Electronics, http://www.AuElectronics.com = ________________________________ From: KP_ To: piclist@mit.edu Sent: Monday, January 19, 2009 8:51:17 AM Subject: [PIC](PIC18F97J60) PICDEM.net 2 + ICD unstable outputs detailed qu= erry! I am working on a couple of PIC18F series boards using ICD2 for debug and program downloads. PIC18F67J50 based custom design with 8 digital ins (PORTD) and 8 digital outs (PORTE) PIC18F97J60 based PICDEM.net 2 prototype board from MicroChip with 4 digital ins (PORTB) and 8 digital outs (PORTJ) While downloading new code onto both the boards using the ICD 2 debugger in both debug and program mode, the outputs seem to be highly unstable - LEDs connected to the outputs seem to flash while the program downloads. This is highly undesirable in the industrial realtime application of the boards as controllers where I dont want a field reprog of the chip using the ICD 2 to operate machinery randomly! Has anyone had similar problems? can anyone explain why this is happening? Seems to happen for sample code (TCPIPStack) thats provided for the PICDEM.net 2 board as well so its more of a PIC + ICD2 issue rather than a coding issue? I do realize the target chip memory maybe used by the ICD - have tried a variety of code and changing memory linker maps but to no avail. The output only fluctuates at innitial programming.. when the output window displays: Programming Target... ...Validating configuration fields ...Erasing Part ...Programming Program Memory (0x0 - 0x9F7F) Verifying... ...Program Memory ...Verify Succeeded Programming Configuration Bits .. Config Memory ...Verify Succeeded ...Programming succeeded 16-Jan-2009, 13:51:29 I realize this is only for a short duration and is perhaps inevitable while programming target in a development/testing environment but I need to know WHY this is happening as the PIC will be used as an industrial controller and we need to rectify this as it will have adverse effects while writing new code in the field (i.e. with the outputs going live uncontrollably during download!). = Since I am still learning, you will have to be slightly patient with me. Included below at the bottom of this message are the configuration bits I am using in the code. CLK is actually software controlled and the CLK0 and CLK1 are manipulated using the FOSC bit which is set to HSPLL. The tick is then manipuilated inside the code at every cycle, if you know what I mean. VPP or MCLR in this case is not manipulated in anyway in my code. DAT and VPP Im not too sure about as I cant find them in the datasheet but if I can impose upon you to visit the datasheet of this demo board at: http://www.microchip.com/stellent/idcplg?IdcService=3DSS_GET_PAGE&nodeId=3D= 1406&dDocName=3Den028217 You will see that I am communicating with the board using RB7 and RB6 on the J4 (in the schematic). This means most settings are set using software since the board ready-developed kit. The RB pins are manipulated in my code the folloing way for IO from the inputs from RB0-RB3 (the 4 push buttons). (in an init function call) elif defined PROCESSOR_PIC18F97J60_CONTROLLER_PICDEM2 =A0 // Inputs =A0 TRISB =3D 0xFF; (in a different function call to load from inputs) #if defined PROCESSOR_PIC18F97J60_CONTROLLER_PICDEM2 =A0 inp =3D PORTB; (specfic PORTB bits also manipulated in every loop) void init_address(void) { =A0 UINT8 delay =3D 100; =A0 // Enable address switch =A0 PORTBbits.RB4 =3D 1; =A0 // Arbitrary settling time =A0 while (delay--); =A0 // Read the address switch =A0 MODULE_ADDRESS =3D (PORTA & 0x0F); =A0 // Disable the address switch =A0 PORTBbits.RB4 =3D 0; =A0 MASTER =3D TRUE; =A0 // If address is non-zeo, this module is a slave =A0 if (MODULE_ADDRESS) =A0 { =A0 =A0 =A0 MASTER =3D FALSE; =A0 } } (config bits file) // The following configuration should be used for development (i.e. WDT =3D OFF, DEBUG =3D ON): =A0 = =A0 // CONFIG1H =A0 #pragma config CP0 =3D OFF=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // Code protection off =A0 // CONFIG1L =A0 #pragma config DEBUG =3D OFF=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 // Background debugging on =A0 #pragma config XINST =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // Extended instruction set on =A0 #pragma config STVR =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // Stack over/underflow reset enabled =A0 #pragma config WDT =3D OFF=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // Watchdog Timer off =A0 = =A0 // CONFIG2H =A0 #pragma config WDTPS =3D 32768=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /= / Watchdog Timer divider =3D 32768 =A0 = =A0 // CONFIG2L =A0 #pragma config IESO =3D OFF=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // Two-speed startup disabled =A0 #pragma config FCMEN =3D OFF=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 // Fail-safe Clock Monitor disabled =A0 #pragma config FOSC =3D HSPLL=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 // Oscillator set to HSPLL =A0 = =A0 // CONFIG3H - different for PIC18F97J60 =A0 //#pragma config ETHLED =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /= / MSSP 7-bit Address masking =A0 //#pragma config MSSPMSK =3D MSK7=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // MSSP 7-bit Address masking =A0 //#pragma config PMPMX =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 // PMP pins placed on EMB (80 pin devices only) =A0 //#pragma config ECCPMX =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /= / ECCP1 outputs to RE6&5 ECCP3 outputs to RE4&3 (80 pin devices only) =A0 //#pragma config CCP2MX =3D DEFAULT=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 // ECCP2 outputs to RC1 =A0 = =A0 // CONFIG3L =A0 //#pragma config WAIT =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 // External Bus wait states off (80 pin devices only) =A0 //#pragma config BW =3D=A0 =A0 ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 // External Bus width =3D 16 bits (80 pin devices only) =A0 //#pragma config EMB1 =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 // External Bus... (80 pin devices only) =A0 //#pragma config EMB0 =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 // ...disabled (80 pin devices only) =A0 //#pragma config EASHFT =3D ON=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /= / External Address Bus shifted to 0000 (80 pin devices only) Thanks and hope you can shed some light on my vows! Best regards, Kashan = -- = View this message in context: http://www.nabble.com/-PIC-%28PIC18F97J60%29-= PICDEM.net-2-%2B-ICD-unstable-outputs-detailed-querry%21-tp21541797p2154179= 7.html Sent from the PIC - [PIC] mailing list archive at Nabble.com. -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist