Using multiple crystals in circuits..

Discussion in 'Embedded Systems and Microcontrollers' started by midnitrcr, Nov 21, 2006.

  1. midnitrcr

    Thread Starter New Member

    Oct 16, 2006
    4
    0
    When working with a circuit that depends on multiple IC's with multiple crystals, do the values of those crystals relate to each other in any way? For instance - I'm working with an Atmega128 microcontroller which also uses an FTDI USB-RS232 chip. Both require crystals to operate. I'm wondering if they have to be the same value? or if each relates independent of the other. My only guess is that if one was significantly faster than the other there may be timing issues in dealing with the transmission of data between each. If that is the case then, I'd like to know what the formula is for determining how fast each must run.

    Thanks in advance!
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    Your question is a bit hard to follow. I will assume that by "IC's" you are actually meaning "microprocessors".

    The clock frequencies are not significant in serial/USB /parallel communications. The data flow is controlled by signals known as handshakes, independant of the system clock. There is a published standard for each method. For RS-232, you will need to explicitly set the baud rate to match in both microprocessors.

    Unless there is some definate reason for having the different clock frequencies per microprocessor, they can probably all run just fine at the rate of the slowest one present. Get one clock oscillator and feed everybody with it.
     
  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    I think the FTDI needs a specific crystal frequency in order to function correctly. There's a limitation on how much frequency difference is allowable for USB transmission.

    The communication between the ATMega and the FTDI can be asynchronous, so they don't have to be in the same clock domain. You just have to watch out for specified communication timing and verify that your codes running at your chosen frequency satisfy the timing requirements.

    Having said that, it is just cheaper to have one oscillator in a small system like this. Since the FTDI most probably need a specific crystal frequency, if you want to put them in the same clock domain, you should verify whether the ATMega would run happily at the FTDI's clock frequency. Otherwise, you need to use different crystals.
     
  4. BladeSabre

    Senior Member

    Aug 11, 2005
    105
    0
    I believe that is true for parallel - but USB, and to some extent RS-232 serial as well, require very accurate timing (so much so with full speed USB that it requires a crystal rather than a ceramic resonator). In RS-232 the higher-level data flow can be controlled by handshakes, but the timing of the pulses that form the bits is clocked independently at both ends, and the two ends have to agree (with quite high precision) in order for the signal to make sense.

    I hope I've not misunderstood what you're trying to say there ;)
     
Loading...