In this article I will talk about soldering the 32768 Hz quartz Xtal that is provided with the G2 Launchpad.
The 32768 Hz Xtal is the basis of a real time clock. In fact 2^15 clock
cycles of that device correspond to one second. In the MSP340 familly we
can use the Watchdog in timer mode associated to it to generate one
interrupt each second.
Launchpad and Xtal bag |
This Xtal is included with the Launchpad package but it is not soldered on the board. As this device uses two MCU pins, you lose two I/O lines when you solder it on the board. It's up to you to decide what is better: a 32768 Xtal or two I/O lines.
The following figure show the position where the Xtal should be soldered.
Xtal Location |
This Xtal is tiny and somewhat difficult to solder. The easiest way to proceed is to fix it in place by means of adhesive tape. Beware that the Xtal is not symmetrical. When correctly laid on the board the contacts should touch the soldering pads.
Xtal fixed with adhesive tape |
Xtal soldered on the board |
Xtal soldered at the three points |
After the Xtal is soldered we should check its correct operation. I have developed a little program to do that. It compiles under MSP-GCC and contain two main files: main.c and io430masks.h.
The program tries to start the oscillator associated to the Xtal. If it works ok, the green LED blinks every second. If the oscillator could not start, it lights the red LED.
If the oscillator cannot start we must first check the soldering.main.c
io430masks.h
The program tries to start the oscillator associated to the Xtal. If it works ok, the green LED blinks every second. If the oscillator could not start, it lights the red LED.
The oscillator is quite sensible to any interference. The oscillator pins are connected to the J2 header as they can also be used for I/O. This connection includes two zero Ohm resistors in the path. To minimize any interference those lines can be disconnected desoldering those resistors.
Resistors removed |
Alternative to soldering the Xtal
If you don't want to mess with the board or you don't want to permanently eliminate two I/O lines you can connect a Xtla to the J2 lines associated to the oscillator.That can be done using the Xtal provided with the Launchpad but its size makes it a little complex. Moreover 32768 Xtals are cheap and easy to obtain. It is important, however, to buy ones designed to operate with 12,5pF or 6pF capacitors. As the MCU includes those capacitor options inside you don't need to add them using discrete components.
This is the Xtal I have bought at Farnell, for instance:
No comments:
Post a Comment