Hardware Reference
In-Depth Information
material is one that will develop a charge when under physical stress. Physical stress can be caused by a small current
running across the material in question. When this small current is applied to the quartz, it will resonate at a set
frequency. In turn this frequency can be measured by an external circuit.
In Figure 8-2 you can see what the inside of a crystal oscillator looks like. This crystal is from a T6 cylinder
package; this will be the same package you use to feed the DS1338Z-33. The quartz crystal needs to be tuned to a
set frequency, which is done when the T6 package is made because the shape and size of the crystal are what set
its frequency.
Figure 8-2. The inside of a T6 package quartz crystal
The T6 package is easy to work with; it can simply be plugged into the breadboard. Crystals do come in many
shapes and sizes; the main thing you need to worry about is the frequency. There is one extra critical part you need for
this little RTC to function correctly. That is the battery: without this the RTC will still operate normally but every time you
power off the device it will lose the date and time, which would seem a little counterproductive for an RTC. I am using
a 3.7-V lithium coin battery. There are other sources you could use; for example, you may want to use a double-layer
capacitor (EDLC) or supercapacitor. I have picked the coin-shaped battery that everyone has seen on pretty much any
recent PC motherboard. This will require you to move away from using just a breadboard but I will cover that later on in
the chapter.
You can easily see why the foundation has chosen to leave an RTC off the Raspberry Pi. It would have used up
a lot of PCB space. Sure, you can get smaller batteries and smaller RTC chips but they are expensive. When I say
expensive, I don't just mean cost, although that is a big one for the Raspberry Pi. Another hidden cost is how you route
the circuits. Crystals are a timing device; therefore, they are sensitive to interference. This comes as an expense in
terms of how you can place and route the tracks for the RTC and its supporting components. It's now time to take a
look at what you will need to build the RTC.
Parts List and Assembly
You're not going to need much for this project because the two main parts are the battery holder and the RTC chip
itself. When I chose an RTC for this project I originally wanted to use the DS1307. The DS1307 is well supported by
the Linux kernel and is very compatible; it's also a DIP 8 package. Unfortunately it's not 3.3 V. Sure, you could use a
level shifter or some other voltage source but I don't like that idea: it's messy and unnecessary. The DS1338 could be
powered just from the Raspberry Pi if you wanted to, as it is fully 3.3-V compliant. The same cannot be said about the
DS1307. In terms of pin out and function, the DS1307 and DS1338 are very, very close. So now here's the parts list:
One DS1338Z-33
One SO-8 adapter
One 32.768-kHz crystal
 
Search WWH ::




Custom Search