EmbeddedRelated.com
Forums

Low level on RESET and P.014

Started by Hard...@allenvanguard.com March 2, 2011
Hi,

I'm working with an LPC 2138. In the manual it mentions that a low on the RESET and P0.14 at the same time issues a request to start the ISP command handler. At this point I should receive a "?" (0x3F) and eventually receive other strings on the serial port.

When I hold RESET and P0.14 LOW at the same time I see the two signals go low on the oscilloscope, however I do not receive any characters back. When I release the two lines, my programmed application immediately begins.

I don't know whether this could be a possible problem, but I am using a FTDI chip to convert serial to USB. I have TX and RX (UART0) from the microcontroller connected to TX and RX on the FTDI chip. I have RESET and P0.14 connected to a switch which I toggle when I want to hold the signals low. I have verified that UART0 works because I can transmit and receive to/from the hyperterminal (serial USB port on my PC) from within my application.

In the manual it mentions the following: "If P0.14 is sampled low and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored." When I do a search for "watchdog overflow flag" in the user manual, it comes back with no search results. Could this be the reason that the ISP command handler on my board is not being called?

Does anyone know why I can't get the ISP command handler to start?

Thanks.
hgida

An Engineer's Guide to the LPC2100 Series

On Wed, 02 Mar 2011 10:00:35 -0500, you wrote:

>Hi,
>
>I'm working with an LPC 2138. In the manual it mentions that a low on the RESET and P0.14 at the same time issues a request to start the ISP command handler. At this point I should receive a "?" (0x3F) and eventually receive other strings on the serial port.

From memory, it doesn't send anything on entry to ISP mode - you send the ? to it and it responds

>When I hold RESET and P0.14 LOW at the same time I see the two signals go low on the oscilloscope, however I do not receive any characters back. When I release the two lines, my programmed application immediately begins.

You need to release reset and keep holding P0.14 Low. Nothing happens while reset is low.

>In the manual it mentions the following: "If P0.14 is sampled low and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored." When I do a search for "watchdog overflow flag" in the user manual, it comes back with no search results. Could this be the reason that the ISP command handler on my board is not being called?

This is something the bootloader does, to stop ISP entry on a watchdog reset, not anything you need
to do.
Thanks for the prompt response back. J

I will keeping holding P0.14 LOW after reset and see if this fixes my
problem. Is there a certain time I should be holding P0.14 low after I
release the board from reset? Will I need to immediately put the "?"
character into the hyperterminal? For example, is there a time window I
must do this in or is it that once the ISP handler has started it'll
remain there until reset?

Thanks.
hgida

From: l... [mailto:l...] On Behalf
Of Mike Harrison
Sent: March 2, 2011 10:05 AM
To: l...
Subject: Re: [lpc2000] Low level on RESET and P.014

On Wed, 02 Mar 2011 10:00:35 -0500, you wrote:

>Hi,
>
>I'm working with an LPC 2138. In the manual it mentions that a low on
the RESET and P0.14 at the same time issues a request to start the ISP
command handler. At this point I should receive a "?" (0x3F) and
eventually receive other strings on the serial port.

From memory, it doesn't send anything on entry to ISP mode - you send
the ? to it and it responds

>When I hold RESET and P0.14 LOW at the same time I see the two signals
go low on the oscilloscope, however I do not receive any characters
back. When I release the two lines, my programmed application
immediately begins.

You need to release reset and keep holding P0.14 Low. Nothing happens
while reset is low.

>In the manual it mentions the following: "If P0.14 is sampled low and
the watchdog overflow flag is set, the external hardware request to
start the ISP command handler is ignored." When I do a search for
"watchdog overflow flag" in the user manual, it comes back with no
search results. Could this be the reason that the ISP command handler on
my board is not being called?

This is something the bootloader does, to stop ISP entry on a watchdog
reset, not anything you need
to do.

This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
On Wed, 2 Mar 2011 10:19:10 -0500, you wrote:

>Thanks for the prompt response back. J
>
>I will keeping holding P0.14 LOW after reset and see if this fixes my
>problem. Is there a certain time I should be holding P0.14 low after I
>release the board from reset?

It's mentioned in the user manual - a few milliseconds from memory.

>Will I need to immediately put the "?"
>character into the hyperterminal? For example, is there a time window I
>must do this in or is it that once the ISP handler has started it'll
>remain there until reset?

AFAIK it will wait forever so no hurry.

>Thanks.
>hgida
>
>From: l... [mailto:l...] On Behalf
>Of Mike Harrison
>Sent: March 2, 2011 10:05 AM
>To: l...
>Subject: Re: [lpc2000] Low level on RESET and P.014
>
>
>
>On Wed, 02 Mar 2011 10:00:35 -0500, you wrote:
>
>>Hi,
>>
>>I'm working with an LPC 2138. In the manual it mentions that a low on
>the RESET and P0.14 at the same time issues a request to start the ISP
>command handler. At this point I should receive a "?" (0x3F) and
>eventually receive other strings on the serial port.
>
>From memory, it doesn't send anything on entry to ISP mode - you send
>the ? to it and it responds
>
>>When I hold RESET and P0.14 LOW at the same time I see the two signals
>go low on the oscilloscope, however I do not receive any characters
>back. When I release the two lines, my programmed application
>immediately begins.
>
>You need to release reset and keep holding P0.14 Low. Nothing happens
>while reset is low.
>
>>In the manual it mentions the following: "If P0.14 is sampled low and
>the watchdog overflow flag is set, the external hardware request to
>start the ISP command handler is ignored." When I do a search for
>"watchdog overflow flag" in the user manual, it comes back with no
>search results. Could this be the reason that the ISP command handler on
>my board is not being called?
>
>This is something the bootloader does, to stop ISP entry on a watchdog
>reset, not anything you need
>to do.
>This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
Hi Mike,

I was looking through the manual at the ISP portion on how to go about
writing a new .hex file to flash. It looks like I have to use the "Write
to RAM" command, then use the "Copy RAM to Flash" command. Is this
correct? Do I copy a bit of the hex file, write to RAM and then Copy RAM
to Flash? Or can I write the whole hex file to RAM and then copy this
into Flash.

Are there any examples (or tips) available showing the back and forth
commands to/from ISP handler and host?

Thanks.

hgida

From: l... [mailto:l...] On Behalf
Of Mike Harrison
Sent: March 2, 2011 10:23 AM
To: l...
Subject: Re: [lpc2000] Low level on RESET and P.014

On Wed, 2 Mar 2011 10:19:10 -0500, you wrote:

>Thanks for the prompt response back. J
>
>I will keeping holding P0.14 LOW after reset and see if this fixes my
>problem. Is there a certain time I should be holding P0.14 low after I
>release the board from reset?

It's mentioned in the user manual - a few milliseconds from memory.

>Will I need to immediately put the "?"
>character into the hyperterminal? For example, is there a time window I
>must do this in or is it that once the ISP handler has started it'll
>remain there until reset?

AFAIK it will wait forever so no hurry.

>Thanks.
>hgida
>
>From: l...
[mailto:l... ] On
Behalf
>Of Mike Harrison
>Sent: March 2, 2011 10:05 AM
>To: l...
>Subject: Re: [lpc2000] Low level on RESET and P.014
>
>On Wed, 02 Mar 2011 10:00:35 -0500, you wrote:
>
>>Hi,
>>
>>I'm working with an LPC 2138. In the manual it mentions that a low on
>the RESET and P0.14 at the same time issues a request to start the ISP
>command handler. At this point I should receive a "?" (0x3F) and
>eventually receive other strings on the serial port.
>
>From memory, it doesn't send anything on entry to ISP mode - you send
>the ? to it and it responds
>
>>When I hold RESET and P0.14 LOW at the same time I see the two signals
>go low on the oscilloscope, however I do not receive any characters
>back. When I release the two lines, my programmed application
>immediately begins.
>
>You need to release reset and keep holding P0.14 Low. Nothing happens
>while reset is low.
>
>>In the manual it mentions the following: "If P0.14 is sampled low and
>the watchdog overflow flag is set, the external hardware request to
>start the ISP command handler is ignored." When I do a search for
>"watchdog overflow flag" in the user manual, it comes back with no
>search results. Could this be the reason that the ISP command handler
on
>my board is not being called?
>
>This is something the bootloader does, to stop ISP entry on a watchdog
>reset, not anything you need
>to do.
>This message is intended only for the use of the named addressee. It
may contain information that is copywritten, privileged, confidential
and exempt from disclosure under applicable law. If you are not the
intended recipient, you are notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If
you have received this in error, please notify the sender immediately
and delete it from your system. Communications using this system are
monitored and recorded for lawful business purposes.

This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
--- In l..., "Hardeep Gida" wrote:
>
> I was looking through the manual at the ISP portion on how to go about
> writing a new .hex file to flash. It looks like I have to use the "Write
> to RAM" command, then use the "Copy RAM to Flash" command. Is this
> correct?

Yes.

> Do I copy a bit of the hex file, write to RAM and then Copy RAM
> to Flash? Or can I write the whole hex file to RAM and then copy this
> into Flash.
>

You need to convert the information in the HEX file before you copy the relevant data to RAM. The Copy RAM command expects blocks of 6-bit uuencoded data. If you have a raw binary image you might find it easier to work with that rather than a hex file.

Why are you attempting to do all this yourself anyway? If you just want to upload a hex file to an LPC2000 device use a tool like FlashMagic:

http://www.flashmagictool.com

>
>
> Are there any examples (or tips) available showing the back and forth
> commands to/from ISP handler and host?
>

If you are asking the questions because you are trying to build an upload tool yourself, we recently went through that exercise ourselves. As part of the upload process we output a trace file showing the back and forth commands to/from ISP handler and host to use for diagnostic purposes if a customer reports problems. You are welcome to look at this if you want. What you need to do is:

1. Download the evaluation version of Astrobe from our site:

http://www.astrobe.com/download.htm

2. Build one of the example applications.

3. Use the Project > Upload command to upload the .bin file to your LPC2000 device.

4. Exit from Astrobe and look at the contents of the text file 'Documents\Astrobe\AstrobeTrace.txt'

Regards,
Chris Burrows

CFB Software
Astrobe v3.3: LPC2000 Oberon-07 Development System
http://www.astrobe.com

Hi Chris,

Thanks for your help.

I have tried using the Flash Magic Tool and I keep getting the same
error "Failed to Autobaud". I've gone through the Flash Magic Forum and
tried debugging the possible reasons given, but I continue to get the
same error. The only difference on my board is that I have an FTDI chip
that converts UART to USB. I'm not sure whether this is the problem?

I'm finding that the chapter that explains ISP to very vague and
unclear. Can I use the ISP commands to write data to a specific location
in flash that's not being used to store the application code? In the
application code I'd like to use the data I wrote to that specific
location in flash. Is this possible with the ISP handler?

Thanks in advance.

Hardeep

From: l... [mailto:l...] On Behalf
Of cfbsoftware1
Sent: March 14, 2011 8:13 PM
To: l...
Subject: [lpc2000] Re: Low level on RESET and P.014

--- In l... ,
"Hardeep Gida" wrote:
>
> I was looking through the manual at the ISP portion on how to go about
> writing a new .hex file to flash. It looks like I have to use the
"Write
> to RAM" command, then use the "Copy RAM to Flash" command. Is this
> correct?

Yes.

> Do I copy a bit of the hex file, write to RAM and then Copy RAM
> to Flash? Or can I write the whole hex file to RAM and then copy this
> into Flash.
>

You need to convert the information in the HEX file before you copy the
relevant data to RAM. The Copy RAM command expects blocks of 6-bit
uuencoded data. If you have a raw binary image you might find it easier
to work with that rather than a hex file.

Why are you attempting to do all this yourself anyway? If you just want
to upload a hex file to an LPC2000 device use a tool like FlashMagic:

http://www.flashmagictool.com

> Are there any examples (or tips) available showing the back and forth
> commands to/from ISP handler and host?
>

If you are asking the questions because you are trying to build an
upload tool yourself, we recently went through that exercise ourselves.
As part of the upload process we output a trace file showing the back
and forth commands to/from ISP handler and host to use for diagnostic
purposes if a customer reports problems. You are welcome to look at this
if you want. What you need to do is:

1. Download the evaluation version of Astrobe from our site:

http://www.astrobe.com/download.htm

2. Build one of the example applications.

3. Use the Project > Upload command to upload the .bin file to your
LPC2000 device.

4. Exit from Astrobe and look at the contents of the text file
'Documents\Astrobe\AstrobeTrace.txt'

Regards,
Chris Burrows

CFB Software
Astrobe v3.3: LPC2000 Oberon-07 Development System
http://www.astrobe.com

This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes.
On 03/15/2011 03:58 PM, Hardeep Gida wrote:
> Im finding that the chapter that explains ISP to very vague and
> unclear. Can I use the ISP commands to write data to a specific location
> in flash thats not being used to store the application code? In the
> application code Id like to use the data I wrote to that specific
> location in flash. Is this possible with the ISP handler?

Did you read about 'C' command? It takes destination address, source
address and how much to copy. Very clearly specified in my opinion. What
is it, that you don't understand?

> *IMPORTANT LEGAL NOTICE *
>
> This message is intended only for the use of the named addressee. It may
> contain information that is copywritten, privileged, confidential and
> exempt from disclosure under applicable law. If you are not the intended
> recipient, you are notified that any dissemination, distribution or
> copying of this communication is strictly prohibited. If you have
> received this in error, please notify the sender immediately and delete
> it from your system. Communications using this system are monitored and
> recorded for lawful business purposes.

Am I being sued now?

--

Timo
--- In l..., "Hardeep Gida" wrote:
>
> I have tried using the Flash Magic Tool and I keep getting the same
> error "Failed to Autobaud". I've gone through the Flash Magic Forum and
> tried debugging the possible reasons given, but I continue to get the
> same error. The only difference on my board is that I have an FTDI chip
> that converts UART to USB. I'm not sure whether this is the problem?
>

If you can't get FlashMagic to work you have less than 0% chance of ever uploading a file by programming it yourself.

Apart from looking in the FlashMagic forum did you try all of the tests listed in App Note 4 "What to do if ISP does not work" on the Resources page?

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

We've successfully programmed different commercial LPC2000 development boards via the USB port using RS232 to USB convertor cables, FTDI breakout boards and onboard UART to USB chips, using both FlashMagic and our own ISP upload code so it *should* work.

If the FlashMagic tips did not help you need to isolate the problem somehow. I'd suggest a few different experiments:

a) Try using a different USB port on your computer
b) Try using a different USB cable
c) Acquire a commercial LPC2000 development board with a USB programming connector (e.g. one of the low-cost Embedded Artists or Coridium Corp boards) and check whether that works with the rest of your system etc. etc.

Regards,
Chris

--- In l..., "cfbsoftware1" wrote:
>
> --- In l..., "Hardeep Gida" wrote:
> >
> > I have tried using the Flash Magic Tool and I keep getting the same
> > error "Failed to Autobaud". I've gone through the Flash Magic Forum and
> > tried debugging the possible reasons given, but I continue to get the
> > same error. The only difference on my board is that I have an FTDI chip
> > that converts UART to USB. I'm not sure whether this is the problem?
> > If you can't get FlashMagic to work you have less than 0% chance of ever uploading a file by programming it yourself.
>
> Apart from looking in the FlashMagic forum did you try all of the tests listed in App Note 4 "What to do if ISP does not work" on the Resources page?
>
> http://www.flashmagictool.com/resources.html
>
> We've successfully programmed different commercial LPC2000 development boards via the USB port using RS232 to USB convertor cables, FTDI breakout boards and onboard UART to USB chips, using both FlashMagic and our own ISP upload code so it *should* work.
>
> If the FlashMagic tips did not help you need to isolate the problem somehow. I'd suggest a few different experiments:
>
> a) Try using a different USB port on your computer
> b) Try using a different USB cable
> c) Acquire a commercial LPC2000 development board with a USB programming connector (e.g. one of the low-cost Embedded Artists or Coridium Corp boards) and check whether that works with the rest of your system etc. etc.
>
> Regards,
> Chris
>
Has ISP ever worked on that particular chip/board? One thought is that the FTDI chip isn't wired properly. Carefully evaluate which direction Tx and Rx are really going.

Hold the LPC in reset and short the Tx and Rx lines at the FTDI chip. Then use the terminal program in FlashMagic to see if you can loop back characters.

Be careful! You need to hold the LPC in reset in order to prevent conflicts. If you let the chip come out of reset, existing code may cause a pin to conflict with the jumper between Tx and Rx

Richard