Forums

URGENT HELP NEEDED!!

Started by MAYURESH M March 28, 2010
Dear all,
I have built a microcontroller development board for LPC2124 and have used a USB interface for programming the device since my PC and laptop both dont have any COM port connector. I have used FTDI's FT232BL chip for the purpose. When connected to the USB port the PC detects it as a USB to Serial converter and treats it as a virtual com port and assigns it a COM port number.

Now for the problem: When i open hyperterminal (baud:38400, no parity, 8 data bits, 1 stop bit, no flow control) and enter the bootloader (by manually setting p0.14 during reset), the controller responds to the commands and it gets synchronized. But when i try to program the board using flash magic, i get an error saying 'unable to communicate (transmit/recieve)'. I have checked all the entries in flash magic like the com port, the device number, crystal frequency etc, and they are correct. Flash Magic is also able to detect the device signature. What can be the problem? Why isn't flash magic communicating with the controller?

Please help me with this problem. I am in a hurry to complete this project in time. Thank you in advance.

Regards
Mayuresh

An Engineer's Guide to the LPC2100 Series

--- In l..., "MAYURESH M"

> when i try to program the board using flash magic, i get an error
> saying 'unable to communicate (transmit/recieve)'.

We have had intermittent problems using FlashMagic to program boards using various USB / COM adapters but haven't isolated any specific causes. Sometimes on a particular board it will fail twice and work the third time etc. On other boards it works first time nearly every time. Also wouldn't work at all on one USB port but worked fine on another!

For best reliability choose a low speed (i.e. 9600 baud). If you are confident you have the right settings if it doesn't work the first time it is worth trying another couple of times without changing anything. Also check here for some tips:

"What to do if ISP Does Not Work"

http://www.flashmagictool.com/assets/resources/ISPProblemsAppNote.pdf

--
Chris Burrows
CFB Software
Armaide: LPC2xxx Development System for Pascal Programmers
http://www.armaide.com

> We have had intermittent problems using FlashMagic to program boards
> using various USB / COM adapters but haven't isolated any specific
> causes.

IME lpc21isp with FT2232 and LPC2148/12MHz works OK up to 38k4.
YMMV.

--

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu

Power supply perhaps?
I have mainly seen this with MAX232 level converters so perhaps less
relevant here but I have seen such problems from noise on 5V or 3V3 power.
Just a small possibility perhaps, but easy to verify/eliminate by
adding decoupling.
If you add a 10uF tantalum and 0.01uf ceramic close to the FT232
power pins, and then if the problem still happens then you can at
least rule this out.

As an aside: I do notice, where I have adapters with Prolific PL-2302
devices that some are unreliable like this on some PCs (especially at
high baud rates). I don't know why. In these cases adding decoupling
has not helped (but other PL2303 devices seem very stable) so I think
there is something more going on.

- Andy

At 10:02 28/03/2010, you wrote:
>Dear all,
> I have built a microcontroller development board for LPC2124
> and have used a USB interface for programming the device since my
> PC and laptop both dont have any COM port connector. I have used
> FTDI's FT232BL chip for the purpose. When connected to the USB port
> the PC detects it as a USB to Serial converter and treats it as a
> virtual com port and assigns it a COM port number.
>
> Now for the problem: When i open hyperterminal (baud:38400,
> no parity, 8 data bits, 1 stop bit, no flow control) and enter the
> bootloader (by manually setting p0.14 during reset), the controller
> responds to the commands and it gets synchronized. But when i try
> to program the board using flash magic, i get an error saying
> 'unable to communicate (transmit/recieve)'. I have checked all the
> entries in flash magic like the com port, the device number,
> crystal frequency etc, and they are correct. Flash Magic is also
> able to detect the device signature. What can be the problem? Why
> isn't flash magic communicating with the controller?
>
> Please help me with this problem. I am in a hurry to complete
> this project in time. Thank you in advance.
>
>Regards
>Mayuresh
>
>
Hi.
A little detail i missed out in my last post. I am powering the board using the USB +5V power itself, not using a separate power supply for the board. The USB 5V supply is then converted to 3.3V using LM1117 regulator and given to the LPC2124.. Is it because of this?? I've seen in some boards that during the programming process the current consumption increases and may be the USB or the LM117 isn't able to provide the necessary current.

Also the crystal i am using is of 14.745MHz. Could it be affecting the programming process??

I have tried programming the board using Phillips ISP flash utility and flash magic both on several PCs and laptops...but no success.

Regards
Mayuresh

The crystal would not be used for the ISP process. The boot firmware runs
off the IRC oscillator (4MHz), and the boot code sets the PLL to oscillate
at 14.something MHz. The presence or absence of the crystal is immaterial.

Yes, I'd look at providing power to the board directly. The USB *should* be
able to provide the required current, but some USB masters, especially those
found on some laptops, don't provide the full rating of current feed.

You mention that you have set the clock frequency in Flash Magic. Did you
set it as 14.745MHz? I suggest you try setting it to 4MHz (simply because
the it runs off the 4MHz IRC).

I'm not an expert on this chip, but have used it a bit. But I do believe
that the last point could hold the clue.

Good luck,

Ahmad

On Sun, Mar 28, 2010 at 9:02 PM, MAYURESH M wrote:

> Hi.
> A little detail i missed out in my last post. I am powering the board using
> the USB +5V power itself, not using a separate power supply for the board.
> The USB 5V supply is then converted to 3.3V using LM1117 regulator and given
> to the LPC2124.. Is it because of this?? I've seen in some boards that
> during the programming process the current consumption increases and may be
> the USB or the LM117 isn't able to provide the necessary current.
>
> Also the crystal i am using is of 14.745MHz. Could it be affecting the
> programming process??
>
> I have tried programming the board using Phillips ISP flash utility and
> flash magic both on several PCs and laptops...but no success.
>
> Regards
> Mayuresh
>
>
>
At 16:32 28/03/2010, Mayuresh wrote:
>A little detail i missed out in my last post. I am powering the
>board using the USB +5V power itself, not using a separate power
>supply for the board. The USB 5V supply is then converted to 3.3V using LM1117

USB power is generally very noisy. Long cables will also add noise
and brownouts to power when your board power consumption peaks. So
always decouple it well.

The LM117 should not have any trouble. It is good for 800ma.

USB power is current limited to 100ma until your USB device
enumerates and requests bus power. Does your USB device do this first?

USB powered devices must be careful not to exceed this value without
first doing correct USB enumeration. I don't know about power
required by 2124 flash programming but it is certainly easy to exceed
100ma by accident eg. if you try to read/write an SD card (especially
if you switch power to the SD card and have another capacitor there).

-Andy