On 03/29/2012 05:02 PM, Uhrheber wrote: > > Also I learned that it isn't a good idea to have a #pragma config DEBUG = ON > statement in the code, because this will permanently lock you out from > JTAG after > flashing. > Can this be circumvented by using a srst at mclr? > > Also you should never use #pragma config JTAGEN = OFF, or > mJTAGPortEnable(DEBUG_JTAGPORT_OFF), but this is pretty obvious. I was digging a little with this DEVCFG0 bits. First, i was not able to program this JTAGEN bit. Always read as 1. Can you really program this bit with your Pickit3 ?.
Strange, but mplabX behaves accordingly to the data sheet and there is a new errata sheet and nothing about this. Perhaps i got a special chip...:) I also put bit CP (Code protection, bit 28) to 0. This disables debug mode, any reset will time out, target not halted. But i can erase it. Bit 0 does nothing related to Jtag. Same behavior when programming it to 0. Bit 1 disables any access to Jtag. I found no way with /MCLR to enable Jtag again. There is something related to this in http://ww1.microchip.com/downloads/en/DeviceDoc/61118F.pdf See 7.4.2. Any idea? I end erasing my chip with a Pickit2 clone and pic32prog. I suppose that mJTAGPortEnable(DEBUG_JTAGPORT_OFF) will put JTAGEN bit to 0 in CFGCON, and disable Jtag. In this case you can set /MCLR at reset level and erase the chip, if you like. You don't need a running cpu to erase the chip. The only purpose of this Jtag disable is for reusing the pins that uses Jtag. That makes me worry a little. Some input can become outputs and can drive or sink more current than the max 15mA as stated in data sheet. I have 100 ohm resistor in each line, so i think i am save, but you?. I don't mean you should not reuse this pins, but be careful. Thanks Salvador ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
