Author Topic: Programming P89LPC930 with CP2102 USB to serial  (Read 11918 times)

OriIdan

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
    • Email
Programming P89LPC930 with CP2102 USB to serial
« on: April 03, 2008, 10:46:46 am »
I am designing a circuit that will contain P89LPC930 and a Silicon Labs CP2102 USB to Serial converter.
How should I connect the output of the CP2102 (It has Tx, Rx, RTS, CTS and other handshake lines).

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #1 on: April 04, 2008, 09:09:57 am »
To do what? Do you want to place the device into ISP mode using the handshaking signals? If so check the user manual for the LPC9xx family, in particular the ISP entry method available. Also consult the MCB900 schematic diagram on the Keil website.

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

OriIdan

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #2 on: April 04, 2008, 09:32:57 am »
ן have looked at the user manual.
I understand that I have to control the Vdd and Reset signal.
My question is regarding the flash magic software, what lines does it control.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #3 on: April 04, 2008, 02:46:25 pm »
It depends on if you want Flash Magic to control VDD and Reset. If so Flash Magic uses DTR and RTS for this purpose, but in a specific way. Look at the schematic diagram for the MCB900 and also read the application note on the Flash Magic website regarding ISP entry.

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

OriIdan

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #4 on: May 19, 2008, 05:09:41 am »
It does not seem to work.

I have followd the application note for FlashMagic programming.
When trying to read device signature:
DTR Starts high and going low for several times
RTS Starts high and going low for several times

I have a scope with only one probe so I can not tell the relationship between these signals.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #5 on: May 19, 2008, 09:24:37 am »
I think you will have to either invest in a scope with two probes or buy the inexpensive MCB900 and compare it's operation with the operation of your circuit. It's very hard for anyone else to help you with custom hardware, especially if your development tools are limited.

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

OriIdan

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #6 on: May 19, 2008, 09:29:29 am »
Can you tell me what waveforms should I expect on DTR, RTS and Tx (of the PC) when trying to read device signature?
It is hard to debug a circuit when I have no idea what waveforms should I expect.
I will use a two probe scope next time, but I need to know the waverforms I should expect.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #7 on: May 19, 2008, 09:34:59 am »
Yes. The waveforms are described in details in the Flash Magic application note on using the COM port handshaking signals.

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

OriIdan

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #8 on: May 19, 2008, 01:38:35 pm »
I am not sure I understand the waveforms I need to use for P89LPC930
The LPC930 does not have a PSEN pin and the waveforms show a PSEN pin.
The circuit I have is very similar to the circuit shown for P89LPC930, however it is using a CP2102 USB to serial converter for connecting to the PC.
The USB to serial outputs the Tx (connected to CPU Rx pin), the Rx (connected to CPU Tx pin) and DTR and RTS signals connected directly to the gates of the 74HC02. they are connected without any clamping resistors since the CP2102 outputs them in TTL levels.

Is there any special setup I need to do in the Flashmagic so it will control the Reset and Vdd lines using RTS and DTR?

I am sorry but the application note is not clear enough what to do (It does not even mention my device, I just assumed it works like P89LPC932), I hope this circuit is right for my device.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #9 on: May 19, 2008, 01:44:40 pm »
I think you are looking at the wrong thing.

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

Open Application Note 1 "ISP entry using COM port handshaking signals".

Scroll down to section "3 P89LPC932".

Look at figures 7 to 12. There is also a detailed description of how this works with the Keil MCB900. You are correct that PSEN is not used.

In Flash Magic select your device then go to:

Options -> Advanced Options -> Hardware Config

Check "Use DTR and RTS to enter ISP mode".

Click on OK

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

Je Gold

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Programming P89LPC930 with CP2102 USB to serial
« Reply #10 on: May 22, 2008, 06:17:16 am »
a)
ISP hardware entry method uses 50uS  pulses and these may be difficult to see on the digital oscilloscope , especially when there are  OTHER initial transients on Vdd, RST Tx and Rx  when the MCB900 circuit operates.


b)
Why would you bother designing a USB to serial  ICP programmer... this has already been done  using the LPC214x and can program
all the LPC900's

It's low cost and can be available here
http://www.teamfdi.com/pages/products_index.html


Joe