LPC932A1 with external crystal problem

Started by kt_chen, April 29, 2007, 11:54:55 PM

Previous topic - Next topic

kt_chen

I have a MCB900 and I use LPC932A1. Originally, I set the LPC932A1 to use internal RC osciilator and it works well. Because I want to improve performance, I change to "High Frequency Crystal/Resonator(4MHz - 12MHz) and put a 12MHz crystal with two 22pF capacitors on the MCB900. After changing, it also can works well, but it can not connect with  the Flash Magic. Even I use 4MHz Crystal and osciilator, it still can not connect with the Flash Magic. Is my LPC932A1 damaged?

Thanks,
kt_chen

Andy Ayre

Have you tried different baudrates? If so which ones?

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

kt_chen

Hi Andy,

Yes, I did. I have tried 2400bps, 4800bps, and 7200bps.

Thanks,
kt_chen

Andy Ayre

Go to:

  http://www.flashmagictool.com/debugstart.html

and try the suggestions listed there. In particular item 13. Let me know your results.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Je Gold

Back to Square  one.

Do you have an oscilloscope that can probe the xtal pins to see if it is oscillating?

Joe

kt_chen

Hi Andy,

I have tried item 13 of the list, but no any code is sent. So I tried again with the other new chip which is set using internal RC, it can send a code, but the code is not "U" or "?". It is like "".

Thanks,
kt_chen

Andy Ayre

No reply means the device is not entering ISP mode. You need to check to see if the oscillator is working as Joe suggested. Double-check for anything else that might stop the device from entering ISP mode.

An incorrect reply (anything other than a 'U') means the device failed to measure the baudrate of the 'U'. Try lowering the baudrate you are using.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Je Gold

So back to square one it is...

Here are a few questions you should ask yourself....

Questions
Just to be clear... Your LPC932A1 can execute the code you programmed in to it - but you can not get it back in to programming mode?

Did you build your own ISP MCB900 programming circuit or are you using the MCB900 directly?
What schematic are using to put the LPC932A1 in to programming mode? (MCB900 cct?)
Can you post the schematic in pdf or jpg or other popular file format?

Do you have an oscilloscope to probe pins on the LPC932A1?

Are the Signal UART Tx, Rx and DTR lines clean on the LPC932A1 side and the RS232 side? (this could cause data problems)

What is the Vdd voltage?  What is the Vdd AC ripple voltage?

What is the DC voltage Xtal1 pin8   - how does that compare to the working LPC932A1?

What is the DC voltage on Xtal2 pin9 - how does that compare to the working LPC932A1?

What is the current consumption on the suspect LPC932A1 - how does that compare to the working LPC932A1?


Is you oscillocope digital and are you able to see the /RST 3 pulses send from the MCB900 circuit (it can be difficult to trigger the oscillocope and capture these - but it can be done)?

Regards
Joe

kt_chen

Hi Joe,

Yes, my LPC932A1 can execute the code which I programmed before I changed to crystal mode, but I can not get it back in to programming mode now.

Actually, I let my MCB900 as a programmer. So I use my MCB900 to program the LPC932A1, then move it to my circuit.

However this LPC932A1 can work well on my circuit except on MCB900. I am also sure that my MCB900 is good, because I have tried the other chip and it can do proramming. But I am afraid that it will occur the same problem, I do not try external crystal mode with the new chip again.

However I will try to measure some of signals which you suggest.

Thanks,
kt_chen

Je Gold

Yes,  this is a catch!

For programming in the MCB900 (ie ISP mode using the  LPC932A1 UART) MUST have one of the following WORKING/Stable  oscillator sources  "THAT HAVE BEEN SELECTED" in the flash programming. Flash User Configuration Byte (UCFG1)

Table 102: Oscillator type selection
------------------------------------
FOSC[2:0] Oscillator configuration
111 External clock input on XTAL1.
100 Watchdog Oscillator, 400 kHz (+20/ −30 % tolerance).
011 Internal RC oscillator, 7.373 MHz ± 2.5 %.
010 Low frequency crystal, 20 kHz to 100 kHz.
001 Medium frequency crystal or resonator, 100 kHz to 4 MHz.
000 High frequency crystal or resonator, 4 MHz to 12 MHz.


The UART in ISP (MCB900) MUST HAVE a stable OSC source.  Perhaps you inadvertently chose the incorrect clock source.... and it harder for the UART  auto baud rate detect on an unstable / slow clock osc source.

So this is a major requirement for MCB900 and ISP programming by the UART.


ICP
-----
ICP is very much more complicated in hardware.....  but does not need a stable core clock source and the PCK and PDA are synchronously clocked in side the LPC932A1 when programmed.



Joe



kt_chen

Hi Joe and Andy,

I have solved this problem. The root cause is the ISP code was broken. I guessed while I did change it to external crystal mode, the ISP code was broken. So after that time, it could not be into ISP mode.

How did I find this root cause? I tried to use ICP and successfully changed back to internal RC. After changing back to internal RC, I tried to let it into ISP mode again but it still failed. So I guessed the ISP code has broken, and I programmed it the new ISP code by ICP. After programming, it can be into ISP mode. Even I change to external crystal mode, it also can be into ISP mode. So I think the broken ISP code is th root cause.

Finally I thank for your helps very much.

Thanks,
kt_chen

Andy Ayre

Do you have any idea how the bootloader could have been corrupted? I've never seen or heard of that happening before.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

kt_chen

Hi Andy,

I do not know what was happening at that time. I try to duplicate the same problem on the same chip, but I still can not duplicate this problem. However I never used the Start Bootloder feature on this chip, I am not sure that whether the booloader have been corrupted.

Thanks,
kt_chen

Je Gold

Hi kt_chen,

My view is if you have "reliable"  ICP hardware (including reliable ICP bridge code)  then run with that as I can program all the current LPC900 family.

What ICP hadware did you use? an MCB900?

Joe

Je Gold

Another option is to use the NoTouch concept

See Here
http://forum.flashmagictool.com/index.php?topic=2231.msg3473;topicseen#msg3473

http://forum.flashmagictool.com/index.php?topic=3279.msg3448;topicseen#msg3448

In your code  when ever you decide the micro needs to be re-flashed - Basically your code just calls the entry point of the ISP bootloader and run Flash Magic (configured for ISP) (for 20pin and above parts).

Eg concept... when ever you see a specific port pin go low  - jump to the entry point of the ISP bootloader.

Joe