Full question(s):
Is there any special initialization that needs to be done when using a 32.768 kHz crystal to clock the Apollo3 Blue, revision B0?
Answer(s):
This only applies to Apollo3 B0 silicon (not needed for A1/A2 silicon). The default mcuctrl.xtalctrl.xtalicomptrim setting is 1 (this is how it is being trimmed in production). However, this setting could cause HFADJ to fail under heavy load or noise conditions. Before HFADJ is enabled, mcuctrl.xtalctrl.xtalicomptrim needs to be set to 3 to prevent this problem.
In addition, for the 32k crystal to startup properly, the mcuctrl.xtalctrl.xtalicomptrim needs to be set to 1. Setting the mcuctrl.xtalctrl.xtalicomptrim to 3 can cause 32k crystal startup problems on some chips.
Here is the register and bit field location:
Name addr End Beg Value
mcuctrl.xtalctrl.xtalicomptrim 0x40020120 9 8 1 (default)
If both HFADJ and the 32KHz crystal is used, here are the requirements:
-
Before HFADJ is enabled, the mcuctrl.xtalctrl.xtalicomptrim needs to be set to 3.
-
Before the 32k crystal is enabled, the mcuctrl.xtalctrl.xtalicomptrim needs to be set to 1. This means that whenever the 32k crystal is disabled/shutdown, mcuctrl.xtalctrl.xtalicomptrim needs to be set to 1 before the 32kHz crystal is re-enabled.
-
After the 32kHz crystal is enabled, a 1 second startup delay needs to be added for the crystal to startup and stabilize before the internal 32kHz clock is used.
Here is the sequence for enabling the 32kHz crystal and HFADJ:
- Set the mcuctrl.xtalctrl.xtalicomptrim to 1.
- Enable the 32kHz crystal.
- Wait 1 second for the 32kHz crystal to startup and stabilize.
- Set the mcuctrl.xtalctrl.xtalicomptrim to 3.
- Wait 1ms (for the 0x1 to 0x3 switch).
- Enable HFADJ.
If HFADJ is not used and only the 32KHz crystal is used, here are the requirements:
- Before the 32k crystal is enabled, the mcuctrl.xtalctrl.xtalicomptrim needs to be set to 1. This means that whenever the 32k crystal is disabled/shutdown, mcuctrl.xtalctrl.xtalicomptrim needs to be set to 1 before the 32kHz crystal is re-enabled.
- After the 32kHz crystal is enabled, a 1 second startup delay needs to be added for the crystal to startup and stabilize before the internal 32kHz clock is used.
Here is the sequence for enabling the 32kHz crystal only (without HFADJ):
- Set the mcuctrl.xtalctrl.xtalicomptrim to 1.
- Enable the 32kHz crystal.
- Wait 1 second for the 32kHz crystal to startup and stabilize.
- Set the mcuctrl.xtalctrl.xtalicomptrim to 3.
- Wait 1ms (for the 0x1 to 0x3 switch).
Comments
0 comments
Article is closed for comments.