Professional Documents
Culture Documents
Atmel AVR Microcontroller MEGA and XMEGA in Assembly and C 1st Edition Han-Way Huang Test Bank 1
Atmel AVR Microcontroller MEGA and XMEGA in Assembly and C 1st Edition Han-Way Huang Test Bank 1
Atmel AVR Microcontroller MEGA and XMEGA in Assembly and C 1st Edition Han-Way Huang Test Bank 1
TRUE/FALSE
1. Devices such as ceramic resonators, crystal oscillators, and RC circuits have been used to generate a
system clock. Among them, the ceramic resonator has the tightest frequency tolerance and should be
used in any system requiring accurate timing.
2. In AVR Mega devices, an external clock source (a square wave with a stable frequency) can be used to
generate clock signals required by all the modules.
ANS: T PTS: 1 REF: 7.3 The Clock System of the AVR Mega Devices
3. In XMega devices, the selection of the system clock source is controlled by the clock system lock
register.
4. In an XMega device, if an external clock source is enabled but not selected as the main system clock
source, and it fails, a failure detector issues a nonmaskable interrupt.
5. An XMega device relies on fuse programming to select the clock generation method
COMPLETION
1. In Mega devices, the clock source selected by the clock multiplexer is further divided by the system
clock prescaler. The possible prescaling factor is chosen by the ____________________ register.
ANS: CLKPR
PTS: 1 REF: 7.3 The Clock System of the AVR Mega Devices
2. The Mega device outputs the system clock on the ____________________ pin.
ANS: CLKO
PTS: 1 REF: 7.3 The Clock System of the AVR Mega Devices
3. The XMega’s clock system includes a(n) ____________________ circuit that can multiply the chosen
clock signal’s frequency so that a higher frequency clock signal can be generated from an internal RC
or external crystal oscillator with a lower frequency.
ANS: PLL
4. The default clock source shipped with a Mega device is a calibrated internal ____________________
at 8.0 MHz.
ANS: RC oscillator
PTS: 1 REF: 7.3 The Clock System of the AVR Mega Devices
5. In the clock system of a Mega device, the operation of the flash memory interface is controlled by the
____________________ clock.
ANS: flash
PTS: 1 REF: 7.3 The Clock System of the AVR Mega Devices
SHORT ANSWER
1. The frequency of a crystal oscillator may not be the same as the on-chip system clock. Briefly describe
how this can be handled.
ANS:
The MCU may include a circuit to multiply or divide the frequency of the oscillator. Frequency
division is achieved by using a countdown counter. However, frequency multiplication must be
performed by a phase-lock loop (PLL). The PLL is a circuit technique that can not only stabilize but
also multiply the clock frequency. Many of the latest MCUs (including the XMega AVR) have
incorporated a PLL circuit on the chip.
2. Briefly describe the function of the oscillator control register (OSC.CTRL) in XMega devices.
ANS:
All the calibrated internal oscillators, the external clock sources, and the PLL output can be used as the
system clock source. The system clock source is selectable from software and can be changed during
normal operation. A clock source must be enabled and stable before it can be selected as the source of
the system clock. The enabling or disabling of the PLL, external oscillator, and internal oscillators is
controlled by the oscillator control register (OSC.CTRL).
3. Briefly describe how a DFLL in an XMega device can improve the accuracy of an internal oscillator.
ANS:
The DFLL compares the oscillator frequency with a more accurate reference clock to do automatic
run-time calibration of the oscillator. The choices for the reference clocks include 1) a 32 kHz
calibrated internal oscillator and 2) a 32 kHz crystal oscillator connected to the TOSC pins. The DFLL
divides the reference clock by 32 to derive a 1 kHz reference. If the internal oscillator runs too fast or
too slow, the DFLL decrements or increments the corresponding DFLL calibration register value by 1
to adjust the oscillator frequency slightly.
ANS:
1. Select internal or external clock reference with the DFLL’s control bit in the DFLL control register
(OSC.DFLLCTRL).
2. Set the DFLL enable bit (ENABLE) in the control register (DFLLRC32M.CTRL or
DFLLRC2M.CTRL) to 1, to enable the DFLL.
3. The calibration process starts immediately.
5. In XMega devices, the DFLL for 32 MHz and 2 MHz internal oscillators belongs to the DFLLRC32M
and DFLLRC2M modules, respectively. Each module has the same set of registers: List the six
registers in the modules.
ANS:
1. DFLL control register (CTRL)
2. Calibration register A (CALA)
3. Calibration register B (CALB)
4. Oscillator compare register 0 (COMP0)
5. Oscillator compare register 1 (COMP1)
6. Oscillator compare register 2 (COMP2)
Pare and core the fruit, having wiped the outside; which, with
the cores, boil with a little water till it tastes well. Strain, and put a
little sugar, and a bit of bruised cinnamon, and simmer again. In
the mean time place the apples in a dish, a paste being put round
the edge; when one layer is in, sprinkle half the sugar, and shred
lemonpeel, and squeeze some juice, or a glass of cyder; if the
apples have lost their spirit, put in the rest of the apples, sugar,
and the liquor that you have boiled. Cover with paste. You may
add some butter when cut, if eaten hot: or put quince marmalade,
orange paste, or cloves to flavour.
Puffs of any sort of Fruit
Make a light batter of eggs, flour, and milk. Fry in a small pan,
in hot dripping or lard. Salt, or nutmeg and ginger may be added.
Sugar and lemons should be served to eat with them. Or, when
eggs are scarce, make the batter with flour, and small beer, ginger,
&c. Or clean snow, with flour, and a very little milk, will serve as
well as eggs.
Irish Pancakes.
Beat eight yelks and four whites of eggs: strain them into a pint
of cream; put a grated nutmeg and sugar to your taste. Set three
ounces of fresh butter on the fire, stir it, and as it warms, pour it to
the cream, which should be warm when the eggs are put to it; then
mix smooth almost half a pint of flour. Fry the pancakes very thin,
the first with a bit of butter, but not the others. Serve several, one
on another.
Fine Pancakes, fried without Butter, or Lard.
Beat six fresh eggs extremely well; mix, when strained, with a
pint of cream, four ounces of sugar, a glass of wine, half a nutmeg
grated, and as much flour as will make it almost as thick as
ordinary pancake batter, but not quite. Heat the fryingpan
tolerably hot, wipe it with a clean cloth; then pour in the batter, to
make thin pancakes.
Bockings.
Boil two large potatoes, and scrape them fine: beat four yelks
and three whites of eggs, and add to the above, with one large
spoonful of cream, another of sweet wine, a squeeze of lemon, and
a little nutmeg. Beat this batter half an hour at least. It will be
extremely light. Put a good quantity of fine lard in a stewpan, and
drop a spoonful of the batter at a time into it: fry them; and serve
as a sauce, a glass of white wine, the juice of a lemon, one dessert
spoonful of peachleaf, or almond water, and some white sugar
warmed together: not to be served in the dish.
Cheesecakes.
Strain the whey from the curd of two quarts of milk. When
rather dry, crumble it through a coarse sieve, and mix with six
ounces of fresh butter, one ounce of pounded blanched almonds, a
little orange flower water, half a glass of raisin wine, a grated
biscuit, four ounces of currants, some nutmeg, and cinnamon, in
fine powder, and beat all the above with three eggs, and half a pint
of cream, till quite light; then fill the pattypans three parts full.
A plainer sort.
Turn three quarts of milk to curd: break it, and drain the whey.
When dry, break it in a pan, with two ounces of butter, till
perfectly smooth: put to it a pint and a half of thin cream or good
milk, and add sugar, cinnamon, nutmeg, and three ounces of
currants.
Cheesecakes, another way.
Mix four ounces of sifted lump sugar, and four ounces of butter,
and gently melt it; then add the yelks of two and the white of one
egg, the rind of three lemons shred fine, and the juice of one and a
half; one Savoy biscuit, some blanched almonds pounded, and
three spoonfuls of brandy. Mix well, and put in paste made as
follows: eight ounces of flour, six ounces of butter; two thirds of
which mix with the flour first; then wet it with six spoonfuls of
water, and roll the remainder in.
Another Lemon Cheesecake.
Boil two large lemons, or three small ones; and, after squeezing,
pound them well together, in a mortar, with four ounces of loaf
sugar, the yelks of six eggs, and eight ounces of fresh butter. Fill
the pattypans half full.
Orange cheesecakes are done the same way, only you must boil
the peel in two or three waters to take out the bitterness.
Orange Cheesecakes.
When you squeeze the fruits, throw the outside in water without
the pulp. Let them remain in the same a fortnight, adding no
more. Boil them therein till tender; strain it from them, and when
they are tolerably dry, throw them into any old jar of candy, you
may have remaining from old sweetmeats; or if you have none,
boil a small quantity of syrup of common loaf sugar and water,
and put over them. In a week or ten days boil them gently in it till
they look clear, and that they may be covered with it in the jar.
You may cut each half of the fruit in two, and they will occupy
small space.
To preserve Gooseberries.
Before they become too large, let them be gathered; and take
care not to cut them in taking off the stalks and buds. Fill wide
mouthed bottles; put the corks loosely in, and set the bottles up to
the neck in water in a boiler. When the fruit looks scalded, take
them out; and when perfectly cold, cork close, and rosin the top.
Dig a trench in a part of the garden least used, sufficiently deep for
all the bottles to stand, and the earth be thrown over, to cover
them a foot and a half. When a frost comes on, a little fresh litter
from the stable will prevent the ground from hardening, so that
the fruit cannot be dug up. Or, scald as above; when cold, fill the
bottles with cold water; cork them, and keep them in a damp, or
dry place: they will not be spoiled.
Another way.
In dry weather pick the gooseberries that are full grown, but not
ripe: top and tail them, and put into open mouthed bottles. Gently
cork them with new velvet corks; put them in the oven when the
bread is drawn, and let them stand till shrunk a quarter part: take
them out of the oven, and immediately beat the corks in tight: cut
off the tops, and rosin down close. Set them in a dry place; and if
well secured from air they will keep the year round.
If gathered in the damp, or the gooseberries’ skins are the least
cut in taking off the stalks and buds, they will mould.
Currants and damsons may be done the same.
To keep Currants.
The bottles being perfectly clean and dry, let the currants be cut
from the large stalks with the smallest bit of stalk to each, that, the
fruit not being wounded, no moisture may be among them. It is
necessary to gather them when the weather is quite dry; and if the
servant can be depended upon, it is best to cut them under the
trees, and let them drop gently into the bottles.
Stop up the bottles with cork and rosin, and put them into the
trench in the garden with the neck downwards. Sticks should be
placed opposite to where each sort of fruit begins.
Note. The directions for gooseberries in case of frost.
Cherries and damsons keep in the same way.
Currants may be scalded, and kept with or without sugar, as
directed for gooseberries.
To keep Codlins for several months.
Boil one third as much sugar as fruit with it, over a slow fire, till
the juice adheres to the fruit, and forms a jam. Keep it in small jars
in a dry place. If too sweet, mix with it some of the fruit that is
done without sugar.
Another way.
Choose steep pots if you can get them, which are of equal size
top and bottom (they should hold eight or nine pounds): put the
fruit in about a quarter up, then strew in a quarter of the sugar,
then another quantity of fruit, and so till all of both are in. The
proportion of sugar is to be three pounds to nine pounds of fruit.
Set the jars in the oven, and bake the fruit quite through. When
cold, put a piece of clean scraped stick into the middle of the jar,
and let the upper part stand above the top; then pour melted
mutton suet over the top, full half an inch thick, having previously
covered the fruit with white paper. Keep the jars in a cold dry
place, and use the suet as a cover, which you will draw up by the
stick; minding to leave a little forked branch to it to prevent its
slipping out.
Observations on Sweetmeats.