Does setting lpc932 to lo power xtal kill ISP?

Started by Nigel B, November 20, 2005, 09:22:01 AM

Previous topic - Next topic

Nigel B


Hello,

am I diagnosing my problem correctly?

I am happily programming and reprogramming p89lpc932's on the MCB900 with Flashmagic while using the chip's RC oscillator.

But when I worked up an application using a low-power 32.778 crystal and set the flash options accordingly, I found I could program the chip once, but not reprogram with later versions of my program.  Flashmagic says it can't connect at the baud rate.

I went through a few chips before I thought:

 Duh!  If each chip is set to use a low frequency clock source, it can't use its own UART properly, so the MCB900 board can't communicate with it on future occasions. I tried reducing the baud rate to 2400, 300 and finally 1 baud! No luck.

Is this really what's happening or is there something I don't understand?

Is there a way round it so as to be able to reprogram chips with 32khz clocks?

I have burned up so many P89LPC 932 I need a new stock.
I got excellent service from Quarndon Elecrtronics once before, but it took them weeks to supply me. Anyone know where I can get a couple of dozen fast?

best.

Nigel

erikm

just figure out possible baud rates with that oscillator frequency an you'll know.

erik

erik

Andy Ayre

I think that when you are clocking the device so slow, it causes problems for the software autobauding. Perhaps the count overflows between the edges, for example.

I suggest you look at using a faster crystal but configure the clock settings on the device to slow the peripherals down. Or use software delays in timer interrupts, etc. Otherwise you might have to make a choice between a slow frequency or using ISP.

Another option (although I cannot confirm it will work) might be to switch to another device in the LPC9xx family that supports ICP. It may be possible to use ICP along with a slow frequency.

Embedded Systems Academy, Inc.
support at esacademy dot com

Nigel B

Thanks to Erik and Andy for advice.

Erik suggested finding baud rates that will work with this slow clock frequency. I had tried r-e-a-l-l-y slow, but had not thought of trying particular baud rates that the system might prefer, so I tried baud rates proportioned to the difference between the RC clock and the crystal. No luck.

Andy, I thinkl I am going to have to develop with faster clocks and dividing down the clock source in the clock divider, but in the end I will have to switch to 32 khz because the power consumption in total power-down with just the real-time clock running is < 1 microamp (my measurement,) which is just what I need.  This final stage of development might therefore cost me a chip every time I want to improve the software!


thanks again.

Nigel

erikm

If you set the "static" clock to the tinternal 7.whatever MHz and AT THE VERY place where the ljmp at 0 goes rewrite the SFR to use your external clock, the extra power will be, say 10ma for 10uS which is not much.

Erik

erik

Jan Waclawek

IMHO the setting of high-medium-low frequency crystal modifies only the drive and/or feedback of the oscillator circuit and not the input, so to recover a chip with low frequency crystal selected, remove the crystal and apply an appropriate high-frequency clock to XTAL1.

Usual disclaimers apply...

Jan Waclawek

Andy Ayre

I checked with Philips, and if you use ICP an external crystal is not a requirement.

Therefore if you switch to an LPC9xx device with ICP, you can use your MCB900 as a "programming dongle", still use Flash Magic, but also allow the option of field firmware updates. All while using 32kHz for a clock.

Embedded Systems Academy, Inc.
support at esacademy dot com

Nigel B

Thank you Erik, Jan and Andy

These are excellent suggestions.

I will try switching clock sources on the fly as Erik suggests. I wonder if I would need to account for the very slow start up and stabilisation of the crystal clock? The pulse of power to the RC clock while waiting a second for the crystal to power up would still be a very small expenditure of energy.

Tomorrow I'll program a chip to put out its CPU clock/2 on the designate d pin and use that as an external  clock source to inject into a 'locked  up' chip in the mcb board. I know now that Jan is right about the flash setting not strongly determining the working  frequency becuase when I just touched the pin for the clock input  on a programmed chip it picked up the UK 100 Hz mains hum from my finger and executed the firmware very slowly.

Andy, I had hoped to put off learning how to do ICP but maybe I'll bring that forward, now.


thanks chaps.

n

Andy Ayre

To get started with ICP, read the Philips application note available on the Flash Magic web page, in the third party section. Summary:

Program your LPC932 on the MCB900 with the ICP to ISP bridge code (also available on the Flash Magic web page).

Connect the MCB900 to your target hardware as described in the Philips application note.

Program using Flash Magic.

On your target hardware you will just need a small header or edge connector to connect the target to the MCB900.

Embedded Systems Academy, Inc.
support at esacademy dot com