AT91SAM7S256 SAM-BA startup problem

I have designed a board with a AT91SAM7S256 on it and intend to program it using the SAM-BA boot program. As I understand it, you need power, a crystal and you should be able to load a program over the serial line. Add a litlle pull-up circuit and choose the right crystal and it can be done through USB.

I have used the SAM7S-EK and that works fine, serial and USB. But my own boards sometimes works and sometimes not. If using USB, in some cases the PC sees the board immediately after powerup, sometimes it may take a very long time (minutes). The same behaviour is observed when using the serial connection. The oscilator is running fine.

When I (finally) have my own software loaded, this will always start immediately.

I've measured and scoped the power lines, osc, reset, tst, erase, but have seen nothing out of the ordinary. Schematic is the same as the EK with respect to the boot loader part.

Any suggestions or simular experiences here?

I've already mailed our FAE, but he has forwarded my question to Rouset, hope they get back to me soon.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)
Reply to
Stef
Loading thread data ...

I have finally tracked down the problem. It was a problem with the oscillator startup caused by placing too high capacitance load capacitors on the crystal. As usual, I placed 2 27pF capacitors. These, combined with some pin capacitance on the CPU, are usually sufficient for an 18pF load capacitance crystal. The AT91SAM7S however has a typical capacitance on the XTAL pins of 40pF (datasheet), which already gives a 20pF load capacitance without any external caps.

I tested the startup by measuring the voltage on PLLRC with a scope. With the external 27pF caps, the voltage on this pin sometimes rises after some milliseconds (> 20), but it can also take (much) more than 10 seconds. The moment the pcb is seen on the USB coincides with the rise on PLLRC. With the external caps removed, the voltage always rises within 20ms. The actual rise is from 0 to 700mV in about 200us.

With the capacitors removed, my pcb's are always immediately seen on the USB. I have also tested with 10pF and that works on one board and not on another, but this is to be expected for an 18pF load capacitance crystal.

I'm still unsure on why my own application always worked properly. Maybe the osc was just running enough out of spec to fail the USB boot, but ran enough for my app. and also for bootloader recovery.

I had measured the osc. startup before by directly putting a scope probe to the xtal pins and had never seen a problem there. The probe may have influenced the oscillator. Also the scope is not an accurate frequency counter, so the freq. may just have been off a little.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)
Reply to
Stef

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.