I have been using the ULINK, uVision3 and the MCB2130 board for a couple months now with no problem. Now I got my first prototype hardware using an LPC2131 and I am not able get the JTAG to work. I get the "JTAG Communication failure" error message. I magically got one to work about 3 times in the past week (3 out of 100). I really can't explain that. I have tried 4 different boards, all the same. I put the long wait state at the beginning of main. I have tried changing the jumper in the ULINK and all the other suggestions from the Keil knowledgebase. I have been able to use the Philips utility to load my code in thru UART0, works fine. The LPC2131 boots up and runs great. In my code I spit out lots of messages to the serial port(to hyperTerminal) so I have verified that the processor is running and doing what it is supposed to do (I have verified I2C, SPI, ADC, UART0, GPIO are all working properly). Watchdog is disabled. Low/Idle power mode is not used and disabled and I am not using the RTC. Everything points to my hardware right!! I know. The one big difference between my hardware and the MCB is clock freq. My board uses a 12.288MHz crystal. I have made the changes to the PLL registers and target freq. I believe all the settings are correct. I use the same interface circuit as the MCB, with 10K pull-ups and pull-downs, with a good clean 3.3V supply. I think I have verified most of the obvious dumb stuff (famous last words), i.e. shorted/open traces, power, gnd,...etc. The only idea I am left with is my layout is too long or noisy? Has anyone else experienced this? I am pretty tight on board space so I don't have room for the big dual row 20-pin header. The ULINK connects to a small dongle board, then a small 14-pin cable takes the signals down to my board. The header on my board is about 1.5 inches away from the LPC2131. Most of the lines are a straight shot, except for the TMS line which runs around and goes under the 12.88MHz crystal and driver. (Yes, I will fix that on the next board spin). Could this less-than-ideal-layout be the problem?????? Should I add buffers to the lines on my dongle board??? Please help. Any input would be greatly appreciated. Thanks, Dave Butler
P0.31 has an internal pull-up. The problem only exists when you have an external load on this pin. Does the your user hardware still not work? Do you have the option to connect with the serial Philips loader tool? Reinhard
@Reinhard There is no pin available for P0.31. So I'm sure a haven't pulled it low. The hole hardware works as expected and can be loaded with the Philips Flash tool. Than I wrote a small test program to handle the JTAG pins P0.26-31 as GPIO. In this mode I can read when inputs and write when outputs. All resistors are correct. I think it's a internal problem from the LPC. The crazy thing is, that JTAG works for few minutes at one of ten boards?!? Günter
Sounds like a CLOCK problem. Is the XTAL stable on the boards?
Hello, Thanks for the suggestion Franc. On my board(LPC2131), P0.31 has a 1k pull up to 3.3V and I have verified that it does not go low after a reset. I am using it as a reset line for a peripheral chip and currently just keep it high all the time. In regards to the XTAL, I am using an external 12.288MHz crystal with a buffer circuit. The output of the buffer has a 100 ohm resistor and drives XTAL1 thru a 100pF cap (as recommended in the manual). The signal looks very clean. XTAL2 is left unconnected. I am starting to suspect a timing issue somewhere in software/firmware. Just a gut feeling?? I will post anything if I find it. Thanks for the suggestions, Dave
I don't think that the software is responsable. I've tested it with erased flash and the JTAG won't work. And I tested it with power off and on to avoid storage things inside the LPC. It looks like the fault happens before the firmware starts running. Comparing the voltage levels at all pins be asserting reset between Keil MCB2100 and the new PCB may be bring light in the darkness. Günter
Günter Thanks, that is a good idea. I will let you know what I find. Dave
All, Problem is fixed. JTAG works on my proto hardware. The JTAG (P1.36-26) pins were configured for GPIO instead of debug. In the PINSEL2 register I had to set bit #2. That did it. All is well now, but I still do not understand why the JTAG worked on the MCB eval board?? I was not setting PINSEL2 bit 2 in my code. Does the LPC2138 not need to have this bit set, where the LPC2131 does? Thanks for your help and suggestions. Dave Butler
Nice to hear. But my JTAG don't work without firmware. So the problem is not really solved, but I'm working on it. Günter
Something wonderful has happen - your computer is alive! I must not understand why the CAN bus pins are used for JTAG features but they are. On my PCB TD1 (P0.26) is connected to a opto coupler which cause the malfunction from the JTAG. Small changes at the CAN interface bring up the JTAG ..oO?! :-) Günter
Excellent. I also do not understand why CAN pins would be used for JTAG?? Glad to hear things are going better. Now you can actually start to work! -Dave