Author Topic: Programming time LPC1114  (Read 7926 times)

jashugan

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • Email
Programming time LPC1114
« on: April 29, 2015, 02:21:26 am »
Hello,
I downloaded the free version of Flashmagic. When I try to program the LPC1114 via ISP, the programming time is very long, about 7 minutes for programming 32 KB of flash. Is it normal such a long time?
I tried to change the baudrate from 1200 to 230400, but the programming time is always the same more or less. I use the 485 half duplex to communicate. Can I reduce the programming time?

Thank you,
Mattia Berton

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming time LPC1114
« Reply #1 on: April 30, 2015, 01:08:33 am »
The bottleneck is RS485 being half-duplex. Every time Flash Magic sends a byte it has to wait for it be echoed back. All the milliseconds add up. Are you stuck with RS485? Can't you use RS232?

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

jashugan

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • Email
Re: Programming time LPC1114
« Reply #2 on: April 30, 2015, 07:52:22 am »
Unfortunately not, it is used for bootloader and communication. In effect I see on the oscilloscope that each byte waits the successive more than 20 ms. Isn't it possible to reduce this wait time?

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming time LPC1114
« Reply #3 on: May 01, 2015, 01:26:28 am »
We double-checked and there is no artificial delay in the Flash Magic code. Is the device taking 20ms to respond each time? If so then there is nothing to be done about that.

If the device takes less than 20ms to respond then please send us:

 1. A debug file - http://www.flashmagictool.com/debugfile.html
 2. The hex file you are programming
 3. An image of your logic analyzer or oscilloscope waveforms with timing information

to support at esacademy dot com, referencing this discussion forum thread. Please note that we will only be able to investigate if we have all three items in the list.

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

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming time LPC1114
« Reply #4 on: May 06, 2015, 02:39:15 am »
Your debug file shows no problems at all, which is good.

I tested your 24kb hex file with a Keil MCB1000 board populated with a LPC11C14/301. In Flash Magic I used half-duplex, 115200 baud, 12MHz crystal setting, use DTR/RTS. My PC is Windows 7 64-bit. I am using a genuine FTDI USB to RS232 cable "US232R-100".

I programmed your hex file several times. The total time for autobauding, erasing and programming was one minute and 15 seconds every time.

For comparison, full-duplex takes nine seconds.

If you are using a USB to RS232 cable then I would suspect yours of inserting a delay. The quality of these cables varies widely, which is why we only use genuine FTDI cables direct from FTDI for testing. So first step is to try replacing that.

If you are using a RS232 to RS485 bridge then I would next suspect that of inserting a delay.

If you are not using one of those cables or a bridge then it could be a Windows issue. Do you have a Win7 64-bit PC to test with?

Andy
« Last Edit: May 06, 2015, 02:54:22 am by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com

jashugan

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • Email
Re: Programming time LPC1114
« Reply #5 on: June 23, 2015, 09:44:25 am »
Hello Andy,
sorry for my late answer, I have been moved to another project. However, I still have to solve this problem.
I tried to change my cables, also tried to program them via UART directly in half duplex, but I had the same latency of 20 ms. However, if I move my communication in Full duplex, the programming time is much more faster.
The reason behind it is that there are more than one packet sent in full duplex, while in half duplex only one byte per time is sent. The distance between the packet is still 20 ms.

Is it possible to reduce this latency of 20 ms? Perhaps in windows? I have Windows 7 64 bit.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming time LPC1114
« Reply #6 on: June 23, 2015, 02:43:46 pm »
I previously wrote that it took me 1 minutes 15 seconds to program your hex file. How long is it taking you after trying different cables and without using an RS485 bridge? Can you please time it and report back. You can get free stopwatch applications for your PC that will help.

Andy
« Last Edit: June 25, 2015, 06:49:25 am by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com

jashugan

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • Email
Re: Programming time LPC1114
« Reply #7 on: June 25, 2015, 12:40:47 am »
I just tried to program the LPC1114 directly from an USB-TTL converter, programming directly via UART.
Programming time in HALF DUPLEX: 9min 37s
Programming time in FULL DUPLEX: 18s

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming time LPC1114
« Reply #8 on: June 25, 2015, 06:49:10 am »
Right OK. So with my setup (Windows 7 64-bit, FTDI USB to RS232 cable, Keil MCB1000 board) I only have 1m 15s. This shows that the delay is not in Flash Magic. It must be somewhere in a difference between your setup/hardware and mine. Unfortunately only you can perform a process of elimination to find out which one it is.

Even your full-duplex is only half the speed of mine. So I would suspect the COM port driver or interface.

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

jashugan

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • Email
Re: Programming time LPC1114
« Reply #9 on: June 25, 2015, 08:03:09 am »
Hello Andy,
you were right! Under the COM port option, advanced, there is a parameter called BM option Latency timer. The default value is 16 ms. Reducing it to 1 ms, I reduced the programming time to 41 s in Half duplex mode using 485 communication.

Thank you for your support.

Mattia Berton