This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can I dynamically change the input clock frequency of the AT91SAM3X8E?

Background:

I'm attempting to use an AT91SAM3X8E microcontroller purchased from www.kynix.com/.../AT91SAM7S128-MU.html(for Arduino Due compatibility) to create a USB to I2SI2S interface. Most I2SI2S CODECs require a master clock that is MCLK=256*BCLKMCLK=256*BCLK where BCLK is the bit clock, which in turn is BCLK=64*FsBCLK=64*Fs. This would be trivial to generate if I was only dealing with one sample frequency, but I would like to retain compatibility for all common values (44.1kHz, 48kHz, 88.2kHz, 96kHz, 196kHz).

I plan to use the microcontroller's Synchronous Serial Controller (SSC) for this task, which it seems very well suited for.

Problem:

All of the I2SI2S clock signals must run off of a multiple of the sampling rate, which varies between two sets - multiples of 44.1kHz and multiples of 48kHz. This means that the clock driving the serial controller must be dynamically switched between two values. At first, I thought that driving the serial controller's transmit clock with the appropriate frequency would be the best option, but that doesn't allow for dynamic clock division for supporting different sampling frequencies. I concluded (perhaps incorrectly) that I need to be able to switch the master clock of the microcontroller in order to address all of these issues.

Question:

Can the AT91SAM3X8E support dynamically changing the clock that it receives on the XIN pin or would that cause run-time errors? If so, would there be a way to get around those (such as temporarily using the RC oscillator)?

Parents
  • Jumping to the RC oscillator and stop/start the crystal oscillator should most probably work - you can't just step the frequency on the oscillator input unless the external hardware makes sure that the switch never produces a short glitch representing a higher frequency. With the RC oscillator selected, such a glitch will not create random execution failures in the processor.

    But I would have to assume that you use two external oscillator modules then, because you can't just switch between two physical crystals connected directly to the processor.

    But why not select a processor with a reasonably powerful PLL and divider logic for the individual peripheral clocks? Even cheaper ARM chips have quite powerful logic to produce many different frequencies. Switching external oscillator frequency means you have to stop all other timing-related tasks in the processor - like UART etc. And if you use the processor clock for timing, your timing will be off.

Reply
  • Jumping to the RC oscillator and stop/start the crystal oscillator should most probably work - you can't just step the frequency on the oscillator input unless the external hardware makes sure that the switch never produces a short glitch representing a higher frequency. With the RC oscillator selected, such a glitch will not create random execution failures in the processor.

    But I would have to assume that you use two external oscillator modules then, because you can't just switch between two physical crystals connected directly to the processor.

    But why not select a processor with a reasonably powerful PLL and divider logic for the individual peripheral clocks? Even cheaper ARM chips have quite powerful logic to produce many different frequencies. Switching external oscillator frequency means you have to stop all other timing-related tasks in the processor - like UART etc. And if you use the processor clock for timing, your timing will be off.

Children
No data