Author Topic: Using the ISP on the LPC2378 should be easy....right?  (Read 19369 times)

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Using the ISP on the LPC2378 should be easy....right?
« on: March 02, 2008, 10:47:01 PM »
Hello all:

I am having a really rough time programming with Flash Magic on a new PCB with a fresh chip. I have very limited experience with this chip.

As a summary:

Power is good, signals are good.

Scope out TX, getting data all the way to the uC.
The RST and INTO lines are being strobed as requried.
The system keeps failing the AutoBaud section of the ISP. In other words, it does not even start.

Suggestions on what I could try next would be appreciated. I even brough up a alternate PCB with just the uC, power, RS232 and control circuits with no luck. I am totally at a standstill here.

Thanks in advance for your suggestions.

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #1 on: March 03, 2008, 12:03:22 AM »
I did scope out the rst and P2.10 lines and they are shown. RST is the top, I would not have expected that little glitch but that is what is coming from Flash Magic.

This has been tried on two separate machines, two separate com ports, two separate boards, identical results.

I also attemped on manually triggering RST and P2.10, sending a U, and waiting for a response. Nothing.

The crystal does not need to function for this correct? It can run off of the internal RC right?

Now sure what else to check, cannot fit more frustration into my weekend......rrrrrrr.


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #2 on: March 03, 2008, 01:09:49 AM »
Hi Steve

As long as you can get the processor into ISP mode and you can communicate you shouldn't have any big problems with FLASH Magic.
As you know, the program can enter ISP mode itself by controlling the ISP (P2.10) and RST lines using control lines on the COM port. This however needs a little HW on your new board to support this so it is probably best to focus on the communication after forcing it manually to the ISP mode.

1. Hold P2.10 at 0V when the RTS line is deasserted. This will put the chip in ISP mode
2. Connected to a terminal emulator (at say 19'200baud) type in ? (question mark)
3. If the answer is "SYNCHRONIZED" then communication is working and there is no reason why FLASH Magic shoudln't also be able to communicate

What I don't know is whether the chip needs a crystal. My quess is that it is necessary, since its internal RC possibly won't be able to achieve accurate enough Baud to communicate (< 5%). However I have only ever worked with a crystal so have no real experience. On the other hand - in the data sheet it states that after a power on reset ISP entry the IRC and PLL are used to generate CCLK of 14.748MHz - this would suggest that it may be possible(?).

From experience I can however say that the chip is very sensitive to glitches and ringing on the RXD line. I also saw lots of problems with people having bad decoupling on their RS232 driver chips which lead to communication problems.

Good luck

Mark

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #3 on: March 06, 2008, 05:50:18 PM »
I have tried this, at various baud rates.

Still no luck.

Everything has been scoped out.

RST is low, P2.10 is low. Let RST rise high, send '?' and I get no response from the uC.

Still lost.

Any other comments? Rails look good.

According to the datasheet, the crystal is only used when the software switches to it so I should be good depending on the internal RC.


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #4 on: March 06, 2008, 10:37:04 PM »
Steve

Are you sure that the chip is operating? Have you all the correct power supplies connected - 1,8V..1,9V on the core and 3V3 on other supply pins?

Can you communicate via JTAG using a debugger? When connected with a debugger in ISP mode you should be able to see the boot software code at address 0x00000000.

Is the RST line really going high at the processor? If the chip has not been programmed it should always start in ISP mode so the state of the P2.10 pin is in fact not important.

Regards

Mark

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #5 on: March 12, 2008, 10:13:27 PM »
As far as I know on this chip, there is only a 3v3 supply. It is running a bit hot right now at 3.4v but still stable. I have not connected to any other power.

I have also attempted to connect via JTAG but am getting a "Communication Error" that I am having a rough time getting away from. Still trying to debug that one as well.

So far, all I have really done is scoped a lot of signals that do not seem to be weird. (Although the RTCK signal from JTAG looked more inductive that like a square wave) I ended with that yesterday.

The reset is going straight to the chip along with P2.10, power and ground.

Are there any lines that I must pull to a known level other than P2.10? Maybe I missed pulling a line high/low causing the uC to go into some weird mode.

This whole thing is becomming extremly frustrating as the only thing on the board right now are decoupling caps, the LPC2378, couple of resistors and the JTAG interface. How much simpler could it get?

To tell you the truth, I have no idea where to even look anymore.

Cheers,

Steve

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #6 on: March 12, 2008, 10:26:01 PM »
Steve

>>As far as I know on this chip, there is only a 3v3 supply.

On the LPC2378 the pins 21,81,98 are VDD(1V8). These can be left floating and then the chip's internal DC/DC converter will generate the supply to the core.
Check carefully that you haven't connected these to 3V3 by mistake.
Checking the MCB2300 board they are floating there.
Checking the Olimex LPC2378 board, they are connected together with optional decoupling capacitors, which are not mounted.

Based on the fact that you can not connect the JTAG (check that RTCK is pulled down via 10k to enable JTAG) it does sound as though the chip is basically not operating...this is bad news!

Regards

Mark

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #7 on: March 12, 2008, 10:32:10 PM »
Thanks for the input.

Pins 21, 81 and 98 are n/c right now and are floating.

I will check that RTCK is pulled down via 10k, it is not right now but I am not in front of my board.

This problem is occuring on a couple of PCBs so I am not so sure that it is the chip. I will check in a couple of hours though.....thanks for the suggestion.

I will keep you posted. If you wake up at 3am with any other suggestions, please let me know.

Cheers,

Steve

Offline Steved

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #8 on: March 12, 2008, 10:43:26 PM »
My mistake, RTCK is pulled low through a 10k via my JTAG board.

Hmmm. That would leave me with not much.......crap.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Using the ISP on the LPC2378 should be easy....right?
« Reply #9 on: March 13, 2008, 12:14:19 AM »
Steve

This is tough.

The 1.8V should be measurable on the pins so maybe you could check that it is indeed being generated correctly internally. If it is not accurate it may indicate a power error some where else.

Have you also connected VBAT (pin 27) to 3V3?

Check this thread: http://tech.groups.yahoo.com/group/lpc2000/message/31801
It is about the LPC2103 (which the uTasker project also supports) where someone strange effects due to not connecting this - I expect the LPC2378 to be very similar though.

Mark

PS If you haven't already tried, is there a difference when using a crystal oscillator?