Author Topic: AT91SAM7S128 and USB crystal frequency  (Read 1724 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
AT91SAM7S128 and USB crystal frequency
« on: January 12, 2010, 10:11:08 PM »
I posted this question here, but the only answer I got was more cryptic than the manual:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=656040#656040


I am confused on which crystal to use. The AT91SAM7S128 can go a max of 55MHz, and for my app, higher the better. However, the manual is confusing me about what I'm limited to using for the USB:

page 26:
"Communication through the USB Device Port is limited to an 18.432 MHz crystal."


on page 146:
"A 48 MHz USB clock is necessary to use the USB Device port. It has been programmed ear-
lier in the device initialization procedure with PLLB configuration."


page 190:
"The USB Source Clock is the PLL output. If using the USB, the user must program the PLL to
generate a 48 MHz, a 96 MHz or a 192 MHz signal with an accuracy of 0.25% depending on
the USBDIV bit in CKGR_PLLR."


So I use a 18.432MHz crystal, but my CPU would still be 48MHz somehow by using div by 48 and mul by 12?

http://www.atmel.com/dyn/products/product_card.asp?part_id=3523

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: AT91SAM7S128 and USB crystal frequency
« Reply #1 on: January 13, 2010, 05:58:06 AM »
At least they replied ... AVR32 and ARM are two different beasts.

The crystal and the frequency of the processor can be different. I guess this is what's messing up your brain. In the AVR, the XTAL freq is the speed at which the processor is running. There are dividers but it is only used for the peripherals, i.e UART, SPI, etc.

The actual crystal frequency can be bumped up by using the multipliers or lowered by the use of the dividers. The ARM processor you are using can do both. It has dividers and multipliers so that you can generate the needed frequencies to drive your peripherals, i.e. the USB. The outputs of the divider, multiplier and PLL (page 187) are fed to the clocks of the various subsystems. Thus with this setup you can achieve several frequencies using one XTAL.

Note that there exists several limits defined also in the manual. Some frequency combination will not work properly (ie that is why it is required for USB to use an 18.432 xtal). Were you planning on using a 50MHz xtal? Not possible with your requirement to use USB, you can't divide and multiply (use the dividers and multipliers) to get a 48MHz freq for the USB clock. If you don't properly use your divider some parts of the system will be fed by too high frequencies which could exceed their max limits.

uc-Harry already gave you the answer "To handle all requirements of the PLL like the lowest frequency of 1MHz you can't div by 48. You can div by 12 only which gives you 192MHz of PLL but the USB has a div by 4 to get its 48MHz. ". He's warning you about the other requirements, take heed.

You can use the output of the PLL (and a divider, 192MHz is a bit tough for an ARM7) to drive the processor clock so that you can get it as close as possible to maximum. Read all the info about MCKR and PLLR registers. Also pages 191 - 194.
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: AT91SAM7S128 and USB crystal frequency
« Reply #2 on: January 14, 2010, 12:52:01 AM »
Quote
The crystal and the frequency of the processor can be different. I guess this is what's messing up your brain. In the AVR, the XTAL freq is the speed at which the processor is running.
Its at least one of the things messing up my brain! Thanks this really helped :)

 


Get Your Ad Here

data_list