Can two atmega328 microcontrollers have a common crystal oscillator as shown?. Will they work perfectly or is there any possibility for short circuit or the microcontroller to get damaged or destroyed? ?
Can two atmega328 microcontrollers have a common crystal oscillator as shown?. Will they work perfectly or is there any possibility for short circuit or the microcontroller to get damaged or destroyed? ?
You can share a common clock between two ATMEGA328s but it is not the way you draw it
If you are talking about having a single Xtal then you would connect this to the XTAL1 and XTAL2 pins of one MEGA328, and wire the Xtal2 (Output) from the one with the xtal to the Xtal1 (Input) of the other 328.. DONE
to quote the 328 PDF section 9.4
9.4 Full Swing Crystal Oscillator
Pins XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can be configured for use
as an On-chip Oscillator, as shown in Figure 9-2 on page 28. Either a quartz crystal or a ceramic resonator may be
used.
This Crystal Oscillator is a full swing oscillator, with rail-to-rail swing on the XTAL2 output. This is useful for driving
other clock inputs and in noisy environments. The current consumption is higher than the ”Low Power Crystal
Oscillator” on page 28. Note that the Full Swing Crystal Oscillator will only operate for VCC = 2.7 - 5.5 volts.
C1 and C2 should always be equal for both crystals and resonators. The optimal value of the capacitors depends
on the crystal or resonator in use, the amount of stray capacitance, and the electromagnetic noise of the environment.
Some initial guidelines for choosing capacitors for use with crystals are given in Table 9-6 on page 30. For
ceramic resonators, the capacitor values given by the manufacturer should be used.
The operating mode is selected by the fuses CKSEL3...1 as shown in Table 9-5.
Notes: 1. If the cryatal frequency exceeds the specification of the device (depends on VCC), the CKDIV8 Fuse can be programmed
in order to divide the internal frequency by 8. It must be ensured that the resulting divided clock meets
the frequency specification of the device.
Notes:
1. These options should only be used when not operating close to the maximum frequency of the device, and only if
frequency stability at start-up is not important for the application. These options are not suitable for crystals.
2. These options are intended for use with ceramic resonators and will ensure frequency stability at start-up. They can
also be used with crystals when not operating close to the maximum frequency of the device, and if frequency stability
at start-up is not important for the application.