smdFan wrote: Why people use oscillators with AVR microcontrollers?
(1) Some uC devices do not have internal (RC) oscillators. (2) Internal oscillators have lower accuracy than external ones.
smdFan wrote:Why they choose different values of oscillators?
Power consumption id directly proportional to clock speed.
Slowing the uC will extend battery life. Some oscillators have "magic"
numbers that when divided down provide industry standard timing
(for serial data comms) or accurate RTC (Real Time Clock) values.
An oscillator with a binary-weighted value requires fewer components
to divide down to a standard frequency. Example: a "32kHz"
crystal is really 32.768KHz, when divided by 2^15 (i.e.
fifteen binary counter stages with no feedback) you will get
1pps (one pulse per second). Used in all digital watches and clocks!
smdFan wrote:What are the considerations when installing a oscillator on PCB? any pitfalls? Should they be closer to AVR? away from power line and source?
Depends if the "oscillator" is analog or
digital. A digital oscillator is a packaged device with all the
analog parts inside, and only supply, ground, and a digital output
pin. The device can be placed "anywhere", but will work
better away from varying temps (power resistors, ICs, etc).
A crystal or resonator requires the internal analog circuits
of the IC (uC in this case). The leads should be very short,
attention paid to both shunt capacitance and short ground
path returns. No other signals (even power and ground) should
pass under or near the crystal and it's loading capacitors.
The capacitors should be NPO types. If the PCB has a
ground or power plane that should be removed under the
crystal and associated traces.