LPC2138 responds using terminal, but unable to communicate using flash magic

Started by preraksheth, July 20, 2011, 11:47:21 PM

Previous topic - Next topic

Madarali

Hi all.
I have the same problem as Prerak with LPC2103.
I will communicate with LPC2103 through terminal and it will respond. but with Flash Magic it doesn't work. i can't read Device Signature with FM.
This is the output of terminal [Baud-Rate=38400_doesn't work with 57600. I'm using Proteus as terminal. Putty can't work because it is asserting the RTS and DTR pins while opening comport]:

?Synchronized
Synchronized
OK
12000
OK
J
0
327441
K
0
21
2

- I'm spend more than a weak and corrupted an LPC2103 and a PCB to achieve these results.
- I try with another computer that have another hardware with win7, it failed. [my PC is Win7-64bit]
- I use Flash Magic for program LPC1768 in ISP mode and it worked.
- I tried any possible setting in Flash Magic. it failed.
- I tried several version of Flash Magic.
- I'm using my PC's comport with several boards and microcontrollers.
I connect 2 LEDs to RESET and P0.14 to monitor the reset and ISP signals. they are working. [it seems that FM uese DTR and RTS for reset/ISP and then ISP/reset]

I can't read the debug file from FM. It seems that it is a binary file. I'm attached the debug file. i'm reading signature and security in debug mode then I'm tying to use terminal to send some commands.
The second debug file is FM with Half-Duplex communication enabled. sometimes it is working. It will able to read signature and security.

If there are any other tests that i can do, please tell me.

Regards
Thanks.

Andy Ayre

Here is a section of your debug file:

tx> ?
rx> Synchronized\d\a
tx> Synchronized\d\a
rx> S^{\df\cf\ef?\edw\fe\fOK\d\a


\d\a = carriage return and line feed.

Flash Magic expects the device to echo "Synchronized" back. This is quite strange. It is almost as if the baudrate has suddenly changed or there are glitches appearing on the Tx line from microcontroller to PC.

Half-duplex works better. In that mode Flash Magic sends one character at a time and waits for an echo. The only idea that comes to mind right now is that a burst of data from the microcontroller is not working.

One difference between the terminal and ISP is that the terminal is being used at human speeds. By the time you have typed in one character it has already been echoed back by the microcontroller before you type in the next character. I.e. it is much slower and similar to half-duplex.

I suggest to put a scope on various points along the transmit path between the microcontroller and the PC and examine the waveform. As you can see the first "Synchronized" is transmitted OK so you will need to compare that with the second transmission. Also compare with using the terminal.

My guess is that you will see more noise and glitches when the data transfer is faster and this is enough to confuse the COM port driver in Windows into thinking it is getting junk.

There is nothing in your problem description or debug files that indicate a way to corrupt a LPC2103 or a PCB. The bootloader is in ROM so it cannot be changed. The PCB is electrical so unless you used DTR/RTS to short circuit the power supply it's not possible for Flash Magic to damage it.

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

Madarali

Hi Andy, and thanks for replay.
I corrupt the PCB and LPC2103 when i was changing the LPC2103 with a new one. because i was thinking that maybe my LPC2103 was corrupted already, for example with ESD.
so you are saying that may be there are some glitches. I will modify the power supply and my RS232 cable to see what happens. but currently I'm using JTAG interface to programming. I'm attached some wires to pins of LPC on the board to make this interface.