SAM7 crystal question

I am building a small test board and wanted to know if i can us a oscillator instead of a crystal. I want to connect a 8mhz oscillator to xin and leave xout unconnected. Is the internal oscillator enough to drive the usb? I want to be able to program the board over usb with sam-ba. Any help appreciated.

megaman:
I am building a small test board and wanted to know if i can us a oscillator instead of a crystal. I want to connect a 8mhz oscillator to xin and leave xout unconnected. Is the internal oscillator enough to drive the usb? I want to be able to program the board over usb with sam-ba. Any help appreciated.

The slow clock (the internal 32-40KHz oscillator) is not fast enough or precise enough to run the PLL at 48MHz for the UDP. Once you’re up and running, you can write your own bootloader to handle whatever crystal frequency will get you a 48MHz UDPCK, but that doesn’t help you to get up and running with SAM-BA.

The DBGU port autobauds, and, so far as I know, will work with your 8MHz oscillator. So you could use that until you’ve managed to get your own USB savvy bootloader written. Or you could just forget about using SAM-BA over USB with that crystal frequency and use the DBGU exclusively.

Thanks lou for the reply. I found a 18.432mhz crystal so I decided to go with that and it works. I have another problem I need help with. How do I generate a 60mhz clock(will 60mhz work or 55mhz max cpu speed?). I know 48mhz is required for usb usage but when the usb is not in use cant the cpu run at full speed?

megaman:
How do I generate a 60mhz clock(will 60mhz work or 55mhz max cpu speed?). I know 48mhz is required for usb usage but when the usb is not in use cant the cpu run at full speed?

You would generate a 60MHz MCK the same way you generate a 48MHz MCK. By running the PLL at twice that speed and prescaling by 2. The code for that is already present any firmware that works at 48MHz with an 18.x MHz crystal. You just need different MUL and DIV, and Atmel provides a tool to figure those out. Using my own private tool, I get DIV and MUL of 96 and 624, respectively, for 60MHz, and 218 and 1300 for 55MHz.

There are specific requirements involved when changing clock speeds at runtime. The manual goes into some detail. It usually involves changing to the slow clock (I know of no reason why it couldn’t be the main clock) while you’re changing the PLL and then waiting for the PLL to lock to the new speed before changing back. I mention this in case you’re planning to use USB some of the time and then run faster when it isn’t in use, which is one way of reading what you said above.

The PLL filter may need to be designed differently depending on the frequecies you want to use. Atmel has a tool for designing the filter, as well. Maybe you can design a filter which works at both speeds. I haven’t used it. I run at 48MHz on boards that were already designed for it. If you’re always running at one speed, the filter, of course, should be designed for that.

60MHz is, as you know, above the rated speed of the chip. The caveats of overclocking PCs apply here as well, and the reasons are the same. Maybe it will work just fine, being overclocked by only 9% . Maybe it will flake out under certain operating conditions. Maybe just one peripheral in the chip will start operating abnormally.