I built a custom board utilizing the LPC2138, including headers for the Sparkfun Serial Boot Loader Interface. When I try to connect to the chip via Flash Magic, I get the autobaud failed error (Interface: None, Oscillator: 20MHz (via external crystal oscillator)). I’ve read the autobaud FAQ, and I was hoping I could get some additional input regarding my particular setup, i.e. the schematic below.
Schematic:https://dl.dropboxusercontent.com/u/131 … ematic.png
To enable the bootloader to run at RESET, P0.14 has to be low.
tried less than 38400baud - because of the 20MHz crystal?
the LPC2xxx with a high enough rev have a fractional divider to get to higher baud rates with a 20MHz xtal, versus using a 14.7456 xtal.
Also- connect the XBee RESET pin to an I/O bit on the ARM, so that when (not if) the XBee gets hung, the ARM can detect that and reset it.
The boot loader interface has a 1K pulldown resistor, and my board has a 100K pullup resistor, so it should be pulled low at reset. Also, thanks for the tip on the Xbee; I guess I expected there to be a software reset command.
Schematic for the Sparkfun Boot Loader Interface http://www.sparkfun.com/datasheets/LPC/LPC-ICP.pdf
Hello odriew,
You’ve verified that your oscillator is running? (I presume the cap values on the schematic are leftovers from something else.)
I don’t have an oscilloscope. Is there a simple way to test the oscillator with a DMM? 12pF is the value listed in the crystal datasheet, but as it turns out I accidentally order 10uF caps. I should be able to obtain the right caps within a day, but as of now I’m assuming the load caps to be the problem.
So, since the 10uF caps were essentially acting as a short to ground for frequencies on the order of 20MHz, I simply removed them. Now, programming works fine, but the oscillator is buggy; I have to jimmy the reset line in order to get it started after unplugging and plugging in power. Can someone explain why this happens? What exactly do the load caps do for the oscillator circuit?
odriew:
The boot loader interface has a 1K pulldown resistor, and my board has a 100K pullup resistor, so it should be pulled low at reset. Also, thanks for the tip on the Xbee; I guess I expected there to be a software reset command.
Schematic for the Sparkfun Boot Loader Interface http://www.sparkfun.com/datasheets/LPC/LPC-ICP.pdf
Software reset can’t work if the XBee’s microprocessor gets hung up. It’s rare (series 1) but it happens. They do have a watchdog timer inside the Xbee’s 8051 micro, and when it fires, you’ll see an unsolicted message saying why it rebooted (power up vs. watchdog).
(I use the binary API mode).
odriew:
The boot loader interface has a 1K pulldown resistor, and my board has a 100K pullup resistor, so it should be pulled low at reset. Also, thanks for the tip on the Xbee; I guess I expected there to be a software reset command.
Schematic for the Sparkfun Boot Loader Interface http://www.sparkfun.com/datasheets/LPC/LPC-ICP.pdf
odriew:
The boot loader interface has a 1K pulldown resistor.
Schematic for the Sparkfun Boot Loader Interface http://www.sparkfun.com/datasheets/LPC/LPC-ICP.pdf
All the boards I've seen have a jumper on P0.14. Ground it when using the bootloader. After the flash is done, remove jumper so the board won't reset into the bootloader again - and not run the user app at location 0.
odriew:
Is there a simple way to test the oscillator with a DMM?
Well… If the DC voltage at XTAL2 (output) is within .5V of either rail, you can be fairly sure the oscillator is not running. If the DC voltage is somewhere between 25 and 75% of Vcc, it might be running.
odriew:
What exactly do the load caps do for the oscillator circuit?
I’m afraid I have to fall back on the old weight-and-spring / resonant-circuit analogy here. At the normal operating frequency, the xtal could be modelled as an inductor. The resonant frequency is determined by the values of the effective inductance and the load caps.
So, how can it run at all with only the board capacitance? I’m out of my depth here, but… Above the normal operating frequency, you approach series resonance and the model of the xtal as an inductor is begins to fall apart. With a 20% frequency increase (I’m making these numbers up) the effective inductance might go up by a factor of 8. So, in this made-up example, if the board capacitance were 12% of the expected total capacitance, the crystal would still resonate at only 120% of the nominal frequency. Not 800% as you’d expect from my original claim that the xtal can be modelled as an inductor.
There are layers and layers (and layers) to crystal oscillator design, and I didn’t find a link that seemed just right. Search for crystal oscillator [design | analysis | model | tutorial]