Instant download Programming pic microcontrollers with xc8 1st edition armstrong subero pdf all chap
Visit to download the full and correct content document: https://textbookfull.com/product/programming-pic-microcontrollers-with-xc8-1st-edition -armstrong-subero/
More products digital (pdf, epub, mobi) instant download maybe you interests ...
Programming Microcontrollers with Python: Experience the Power of Embedded Python 1st Edition Armstrong Subero
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Cover image designed by Freepik
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Natalie Pao
Development Editor: James Markham
Technical Reviewer: Logan West
Coordinating Editor: Jessica Vakili
Copy Editor: Kezia Endsley
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit http://www.apress.com/rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-3272-9. For more detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
About the Author
Armstrong Subero has been tinkering with electronics for as long as he can remember. The thrill of creating something from the ground up and watching it work is something that he never tires of. His entire life changed when he discovered microcontrollers. They were so powerful and simple and complex all at the same time. When he finished school, he taught himself programming and, for a while, worked part-time from a home office. He landed his first job as a systems technologist completely self-taught and a lot of it was due to his in-depth knowledge and passion for the microcontroller technology. Armstrong has used many microcontroller families during the course of his work, but he has an affinity for PICⓇ microcontrollers. Armstrong currently works for the Ministry of National Security in his country. He designs robots and writes books, blogs, and software on trinirobotics.com and angelstemlabs.org in his free time.
Introduction
With the onset of the Internet of Things (IoT) revolution, embedded systems development is becoming very popular in the maker community and the professional space as well. IoT is a trillion-dollar business. PICⓇ microcontrollers are one of the technologies that can be used to develop IoT devices. This is due to the low cost, wide availability, and low power consumption of these devices. Additionally, due to the wide range of PICⓇ microcontrollers available, there are PICⓇ microcontrollers that can match your designs, from 8 pins to over 144 pins. They covers 8-, 16-, and 32-bit architectures.
People argue that 8-bit architecture is irrelevant in the complex embedded systems of today. However, 8-bit microcontrollers are here to stay, even if it is for the simple purpose of learning about microcontroller architecture. The relatively simple and beautifully engineered architecture of 8-bit PICⓇ microcontrollers makes them invaluable for learning the inner workings of microcontrollers. It is a lot easier to learn all the registers of these simple 8-bit devices and follow the path of program execution than with more complex ones. After learning about PICⓇ microcontrollers, I found it easy to move on to the more popular 16-bit and then 32-bit devices. In this book, I hope to share the tips and tricks I learned along the way.
Why Did I Write This Book?
When I first started programming PICⓇ microcontrollers, I imagined that a lot of information would be available on the Internet on which people could base their designs. Little did I know at the time that programming
InTroduCTIon
these useful devices would take a lot of work, dedication, and finding code that actually worked. In addition, when I did find code, it was usually for ancient PICⓇ microcontrollers that are NRND or have a lack of modern peripherals and capabilities. When I finally did find a suitable language in the name of HI-TECH C for the PICⓇ microcontroller series, I found out that XC8 would be released to take its place. Despite being compatible with HI-TECH C, I realized upon using the compiler that a lot of the code did not work out of the box and a lot of my libraries had to be rewritten. This was a time-consuming process and the lack of information on the language was frustrating, leaving me to think that XC8 was not everything I expected it to be.
A lot has changed since then. Now I love XC8 and all the features it provides and I’m thankful that Microchip provides it free of cost. A lot of people might wonder why I chose XC8 to program PICⓇ microcontrollers when other simpler options in BASIC and C exist with a lot of libraries available. To them I say that even if those languages are easier to use, there are some versions where the libraries are not open and thus cannot be examined. In cases where software must receive government approval, closed libraries are not an option. Also, the knowledge gained from writing your own libraries is invaluable. Microchip technology provides the MPLABⓇ Code Configurator (MCC) that can generate code to use the onboard peripherals of a lot of PICⓇ microcontrollers and, even more recently, for Click boards using the ubiquitous mikroBUS for communication. The other reason is that by learning to use the compiler provided by the manufacturer, you avoid the problem of a chip with a killer new feature not being supported by the manufacturer of a third-party compiler. For the sake of understanding exactly what is happening, I make minimal use of the MCC in this book despite its ease of use.
Who Is This Book For?
For this book, you will need some basic electronic devices and some electronic equipment and knowledge of how to use them. I expect that the reader has knowledge of the C programming language. Knowledge of variables, loops, and basic data structures will suffice. I also assume you have knowledge of basic digital electronics. I also make the presumption that you have used another simpler platform, such as Arduino, since the focus of this book is on the specifics of the PICⓇ microcontroller. A complete newcomer can follow along, but this book is heavy on code, schematics, and images and focuses less on the theoretical aspects of using microcontrollers.
What You Will Need for This Book?
You will need a few components to get all the examples up and running. All of these are covered in Chapter 1. I know of individuals who build microcontroller circuits in simulation. I recommend building the actual circuits to gain hands-on experience that will help you in the industry. Unlike other programming disciplines, embedded systems development allows you to build things that can be used in our physical world, not just push pixels around the screen. I have also found it more enjoyable to prototype circuits, as you also learn valuable skills in circuit design and troubleshooting that you will have for a lifetime. Although for many people using a development board is simpler, for those wanting a true “hands-on” approach to learning, prototyping on breadboards is a valuable skill.
What Will You Learn in This Book?
This book consists of 15 chapters that will help you get on your way to programming PICⓇ microcontrollers in XC8.
• Chapter 1 looks at setting up shop, including the hardware and software necessary to get the most out of this book.
• Chapter 2 covers the basics of the C programming language.
• Chapter 3 reviews the basics of electronics.
• Chapter 4 presents the basics of PICⓇ microcontrollers and looks at the PIC16F1717.
• Chapter 5 covers the basics of connecting your PICⓇ microcontroller to your computer.
• Chapter 6 presents the basics of I/O, including PPS, interfacing LEDs, push buttons, and seven segment displays.
• Chapter 7 demonstrates using actuators, DC motors, servos, and stepper motors.
• Chapter 8 examines the use of interrupts, timers, counters, and PWM.
• Chapter 9 presents the use of serial communication protocols, including USART with GPS and GSM, SPI, and I2C.
• Chapter 10 looks at using displays including the SSD1306 and Nextion touch screen displays.
• Chapter 11 consists of understanding the ADC and DAC.
• Chapter 12 covers using the onboard peripherals of the CLC, NCO, Comparator, and FVR.
• Chapter 13 takes us into the wireless connectivity with Wi-Fi and Bluetooth.
• Chapter 14 demonstrates the use of the low-power features of the microcontroller, minimizing power consumption and the WDT.
• Chapter 15 is a project-based chapter where we build two projects.
Upon finishing this book, I hope that you will have the foundation you need to take on the world of embedded systems design and build useful gadgets, IoT devices, and beyond. This is the book I wish I had when I was getting started with PICⓇ microcontrollers.
CHAPTER 1 Preparing for Development
It would be nice to be able to jump right into building projects and using our microcontroller. However, before we do so, we need to properly set up our environment for working. This chapter is catered to people who have used microcontroller platforms such as Arduino, PICAXE, or Basic Stamp-based platforms and want to build barebones microcontroller systems. Beginners should have no trouble following along though. If you have experience breadboarding circuits or using ICSP tools or have previously used PIC® microcontrollers, you may skip this chapter. However, I strongly recommend that you read this chapter, as it provides a lot of insight as to what you need as well as getting everything prepared.
Gathering Your Hardware
This is the first chapter on your journey to embedded systems design with PIC® microcontrollers and XC8. The first thing we will do is gather the necessary components you will need to follow along with this book. Long gone are the days where a couple thousands of dollars would be needed to begin microcontroller development. For relatively little money, you can experiment with microcontroller development. This is especially true of PIC® microcontrollers, where for a few pennies, you can purchase one of these ubiquitous beasts.
A. Subero, Programming PIC Microcontrollers with XC8, https://doi.org/10.1007/978-1-4842-3273-6_1
People familiar with programming place emphasis on writing programs, while people with a background in electronics place emphasis on building the circuits for the controllers. I have found that both are equally important and, as you follow along with this book, remember that not everything can be solved using software. If you correctly learn how the hardware operates, you could potentially write very little code that combines hardware in unique ways to get the desired result.
Let’s jump into it and look at the things you will need.
Microcontroller
Although the book generally assumes that you have some experience with microcontrollers, this section reviews the basic microcontroller technology. Read this section thoroughly if you’re a first-time user of microcontrollers. The information you learn in this section will not only be applicable to PIC® microcontrollers, but also to other microcontrollers you may use.
General-purpose computers such as the smartphones, tablets, laptops, and desktops are designed to perform a variety of tasks. A laptop or tablet can be used to read books, watch movies, and even write programs and web applications. This is because they were designed for that purpose, thanks to the integration of the microprocessors into these units that allow them to perform these many different tasks.
The microprocessor, however, is not an island. It is dependent on supporting circuitry in order to work properly. These include RAM chips, SSD, and other peripherals. While it is revolutionary, the strength of the microprocessor is also its shortcoming. Although it can perform general tasks, it may not be the best solution for performing a single task.
Let’s take the example of an electric toothbrush. If we want to design a basic electric toothbrush, then some basic considerations must go into its function. The toothbrush must turn on a motor when the user pushes a button and alert the user if they have been brushing their teeth too long. In Chapter 1 preparing for Development
Chapter 1 preparing for Development
such an instance, a minimum of processing power is needed to adequately perform this task. Yes, it is possible to program a board that contains a 4GHz 64-bit processor with 16GB of RAM running the latest OS to do this task, but that would be akin to using a lawnmower to shave your legs. It would be better for many reasons to use a microcontroller.
So what exactly is a microcontroller? A microcontroller is a selfcontained unit that has a microprocessor with RAM, ROM, I/O, and a host of other peripherals onboard. Thus a microcontroller contains all the processing power necessary to perform the specific task at hand and that task alone. Back to the toothbrush example, it would be more feasible to use a 4-bit microcontroller with a few bytes of RAM and ROM to check the switch, turn on the motor, keep track of how long the user has been brushing, and sound an alarm if that time exceeds some preset value.
Microcontrollers are used for applications that have specific requirements such as low-cost, low-power consumption and systems that require real-time performance. It is thanks to these features that a world where computers are becoming increasingly ubiquitous is now possible.
At the time of writing, there are 4-, 8-, 16-, and 32-bit microcontrollers. Anyone looking to start a new design should realistically choose an 8-bit or a 32-bit microcontroller. Large volume, low-cost, and lowest power consumption 8-bit devices generally tend to have an edge. Whereas for higher performance applications, 32-bit devices are the obvious choice. It is very important that you do not get attached to one particular microcontroller. There are people who insist that they can do anything with 8-bits, whereas others only use 32-bit parts. You must realize that microcontrollers are simply tools applied to the particular task, so it stands to reason that some tasks are better suited to 8-bit microcontrollers and others to 32-bit ones.
The microcontroller we use in this book is the 8-bit PIC16F1717 (see Figure 1-1). The PIC® microcontroller was chosen because it has a relatively simple architecture. Once you understand 8-bit PIC® microcontrollers, it’s easy to understand more complex micros. I chose this
particular PIC® microcontroller because it is a modern device and has a lot of onboard peripherals. It also has a relatively large amount of RAM and program memory and, most importantly, a lot of onboard peripherals. There are members of its family with the same features that have a smaller pin count.
A benefit of this particular microcontroller is that, in addition to being modern, it is produced in a DIP package, which makes it very easy for prototyping on a breadboard. Therefore, you use it to test your design and use an SMD version in the final version of your product.
Programmer
A microcontroller is a blank slate without a program. Microcontrollers and other stored program devices rely on a programmer to load the program to the chip. I have found that using a microchip makes it easiest to understand how to program devices. Many device vendors have extremely expensive tools that are hard to find, even on their own web site! In order to program PIC® microcontrollers, you need a PICkit™ 3 or an MPLAB® ICD 3. I personally have used both and highly recommend that you buy an ICD 3. The reason is that the ICD 3 is much faster and saves you a lot of time in programming and debugging, especially if you plan on moving up to the larger devices. However, you should only buy the ICD 3 if you are certain that you will be working with PIC® microcontrollers for a long time, as
Figure 1-1. PIC16F1717 in DIP package
Chapter 1 preparing for Development
at the time of writing, it costs over $200. The PICkit™ 3 may be used if you are evaluating the PIC microcontroller series, as it is available for $50.00. Generally, get the PICkit™ 3 if you are evaluating PIC® microcontrollers and the ICD 3 if you intend to work with these devices for a while.
Figure 1-2 shows the PICkit™ 3 and Figure 1-3 shows the ICD 3.
The ICD 3 uses an RJ-11 type adapter. I recommend that you get this programmer as well as an adapter to allow for easy breadboaring from RJ-11 to ICSP.
Figure 1-2. PICkit 3
Figure 1-3. ICD 3
Gathering the Software
The hardware is necessary for building the circuits. However, we are not fiddling with 555 timers here! We need software to make everything work. All the software needed to program PIC microcontrollers can be found on the Microchip Technology web site.
MPLAB® X IDE
I have heard people complain about the old IDE microchip thousands of times. Let me assure you that MPLAB® X is nothing like MPLAB® IDE (see Figure 1-4). It is a lot better. Microchip technology has come a long way. I have used a lot of vendor tools and Microchip offers the most effective plug-and-play functionality I have come across. Some rather pricey compilers don’t offer much more over the ones provided for PIC® microcontrollers. In fact, Microchip even offers an IDE that is cloud based! This cloud-based MPLAB® Xpress IDE is best suited for new users or if you want to program the microcontroller on a machine that you need special permissions for. A good example of this is would-be students or a corporate environment where going through the IT department would be a lengthy process.
If you purchased an Xpress evaluation board and are still not sure if you want to use the PIC® microcontroller, then you may use the cloudbased IDE to get up and running quickly. However, if you decided on using PIC® microcontrollers then the on-premises software for microcontroller development is a lot better. The primary reason is that if something goes wrong, you can be assured that it is not a connection problem. The other reason is that as your code grows and your skills develop, you will need all the features of MPLAB® X, which has the power of NetBeans behind it. Stick with the on-premises software.
I know there are going to be those among you who prefer to use a command-line interface and text editor. In fact, I also enjoy that method of doing things, when there is no IDE available. I like the KISS principle—let’s not make things more complicated than they need to be. This book takes a pragmatic approach. IDEs are simple to use. Thus we use them.
XC Compilers
A lot of people don’t value compilers. Many vendors boast about how easy it is to get started with their chips and pack mouthwatering goodies into every bite of silicon. However, they make the compilers so expensive that they aren’t worth it in the end. Microchip offers the XC compilers to get started with PIC® microcontrollers. The best part is it’s free of charge. In this book, I focus on XC8. However, be rest assured that once you get over the learning curve of how this compiler operates, you will be thankful that you chose to use PIC® microcontrollers. This is because it is easy to transition from 8- to 16- and 32-bit microcontrollers without having to learn a totally different environment. The XC8 compiler is available for download on the Microchip technology web site.
Figure 1-4. MPLAB X IDE
Setting Up Shop
In this book, I interface the microcontroller to a lot of modules and design a lot of circuits. However, if you want to do likewise, it is very important that you acquire at least a minimum of equipment to be able to get the most of this book. Recommended equipment is covered in the following sections.
Multimeter
The multimeter is a staple of electronics. Therefore I highly recommend you invest in at least two multimeters. The reason you need at least two is because you need to measure voltage and current at the same time. For this book, any multimeter that has the ability to measure DC voltage, current, and resistance should suffice.
Oscilloscope
No electronics workbench, lab, or shop is complete without an oscilloscope. This device is undoubtedly one on the most important test instruments you’ll have, particularly when you’re working with microcontroller-based circuits. Even if you do not want a full scope, I recommend you get the Velleman pocket oscilloscope. It is reasonably priced and works rather well for basic work.
Power Supply
Make sure to get a good bench power supply. The 1.2v-15v range and at least a 5 amp rating will suffice.
Shopping for Supplies
When starting with microcontrollers and electronics in general, people often wonder where they can buy supplies and items. In general, you can buy most of these items from Amazon, eBay, Digi-Key, Mouser Electronics, or and AliExpress. I recommend you buy passives from sites like AliExpress and eBay, as you are likely to get better deals on these in the Chinese market. However microcontrollers, active devices in general, and programmers should always be bought from reputable suppliers, as they may not be genuine or may not function as required. In fact, there are instances where companies bought chips (namely ATmega328p) from the Chinese market and it turned out that these chips were total imitations and did not work.
To sum it all up: be vigilant when purchasing electronic components and equipment. If it’s too good to be true, then stay away. Do not buy it.
In general you need to set up a basic electronic shop. You need various resistors, capacitors, and a few semiconductors and of course your basic side cutters, pliers, and screwdrivers.
Table 1-1 lists the components you need to purchase to get the most out of this book.
mouser electronics 821-1n4001 (continued) Chapter 1 preparing for Development
Digi-Key electronics C503B-rCn-CW0Z0aa1-nD
mouser electronics 941-C503BaanCY0B025
Digi-Key electronics 641-1310-3-nD
Another random document with no related content on Scribd:
KOHL CANNON, OR KALE CANNON.
(An Irish Receipt.)
Mix in about equal proportions (these can be varied to suit the convenience of the moment) some smoothly mashed potatoes, and some young sprouts or greens of any kind, first boiled quite tender, pressed very dry, and chopped a little if needful. Mash up the whole well together, add a seasoning of pepper and salt, a small bit of butter, and a spoonful or two of cream or milk; put a raw onion into the middle of the mass, and stir it over a clear fire until it is very hot, and sufficiently dry to be moulded and turned out for table, or dished in the usual manner. Take out the onion before the kohl cannon is served. In Ireland mashed parsneps and potatoes are mingled in the same way, and called parsnep cannon. A good summer variety of the preparation is made there also with Windsor beans boiled tender, skinned, and bruised to a paste, then thoroughly blended with the potatoes. Turnips, too, are sometimes substituted for the parsneps; but these or any other watery vegetable should be well dried over a gentle fire as directed for mashed turnips in this chapter, before they are added to the potatoes.
TO BOIL SEA-KALE.
Wash, trim, and tie the kale in bunches, and throw it into plenty of boiling water with some salt in it. When it is perfectly tender, lift it out, drain it well from the water, and send it to table with good melted butter. When fashion is not particularly regarded we would recommend its being served upon a toast like asparagus. About twenty minutes will boil it, rather less for persons who like it crisp.
18 to 20 minutes.
SEA-KALE STEWED IN GRAVY. (ENTREMETS.)
Boil the kale for ten minutes in salt and water; drain it well, and put it into a saucepan with as much good brown gravy as will nearly cover it; stew it gently for ten minutes or until it is tender, and send it to table in the gravy very hot. Another excellent mode of serving this vegetable is, to boil it in salt and water, and to pour over it plenty of rich white sauce after it is dished.
SPINACH. (ENTREMETS.)
(French Receipt.)
Pick the spinach leaf by leaf from the stems, and wash it in abundance of spring water, changing it several times; then shake it in a dry cloth held by the four corners, or drain it on a large sieve. Throw it into sufficient well-salted boiling water to allow it to float freely, and keep it pressed down with a skimmer that it may be equally done. When quite young it will be tender in from eight to ten minutes, but to ascertain if it be so, take a leaf and squeeze it between the fingers. If to be dressed in the French mode, drain, and then throw it directly into plenty of fresh water, and when it is cool form it into balls and press the moisture thoroughly from it with the hands. Next, chop it extremely fine upon a clean trencher; put two ounces (for a large dish) of butter into a stewpan or bright thick saucepan, lay the spinach on it, and keep it stirred over a gentle fire for ten minutes, or until it appears dry; dredge in a spoonful of flour, and turn the spinach as it is added; pour to it gradually, a few spoonsful of very rich veal gravy, or, if preferred, of good boiling cream (with the last of these a dessertspoonful or more of pounded sugar may be added for a second-course dish, when the true French mode of dressing the vegetable is liked.) Stew the whole briskly until the liquid is entirely absorbed; dish, and serve the spinach very hot, with small, pale fried sippets round it, or with leaves of puff paste fresh from the oven, or well dried after having been fried. For ornament, the sippets may be fancifully shaped with a tin cutter A proper seasoning of salt must not be omitted in this, or any other preparation of the spinach.
SPINACH A L’ANGLAISE. (ENTREMETS.)
(Or, English fashion.)
Boil the spinach as already directed, and after it has been well squeezed and chopped, stir it over a moderate fire until it is very dry; moisten it with as much thick rich gravy as will flavour it well, and turn and stew it quite fast until it is again very dry; then press it into a hot mould of handsome form, turn it into a dish and serve it quickly Two or three ounces of fresh butter may be laid into the saucepan with the spinach at first, as a substitute for the gravy. When a perforated tin shape, ordinarily used for moulding spinach, is not at hand, one of earthenware, slightly buttered, will serve nearly as well.
SPINACH.
(Common English mode.)
Boil the spinach very green in plenty of water, drain, and then press the moisture from it between two trenchers; chop it small, put it into a clean saucepan, with a slice of fresh butter, and stir the whole until well mixed and very hot. Smooth it in a dish, mark it in dice, and send it quickly to table.
ANOTHER COMMON ENGLISH RECEIPT FOR SPINACH.
Take it leaf by leaf from the stalks, and be very careful to clear it from any weeds that may be amongst it, and to free it by copious and repeated washings from every particle of sand, or earth. Put it into a large well-tinned stewpan or saucepan, with the water only which hangs about it; throw in a small spoonful of salt, and keep it constantly pressed down with a wooden spoon, and turned often for about a quarter of an hour, or until it is perfectly tender. Drain off the superfluous moisture, chop the spinach quickly on a hot trencher; dish and serve it immediately. Fried sippets of bread should always be served round this vegetable, unless it be prepared for an invalid.
TO DRESS DANDELIONS LIKE SPINACH, OR AS A SALAD.
(Very wholesome.)
This common weed of the fields and highways is an excellent vegetable, the young leaves forming an admirable adjunct to a salad, and much resembling endive when boiled and prepared in the same way, or in any of the modes directed for spinach. The slight bitterness of its flavour is to many persons very agreeable; and it is often served at well-appointed tables. It has also, we believe, the advantage of possessing valuable medicinal qualities. Take the roots before the blossom is at all advanced, if they can readily be found in that state; if not, pluck off and use the young leaves only. Wash them as clean as possible, and boil them tender in a large quantity of water salted as for sprouts or spinach. Drain them well, press them dry with a wooden spoon, and serve them quite plain with melted butter in a tureen; or, squeeze, chop, and heat them afresh, with a seasoning of salt and pepper, a morsel of butter rolled in flour, and a spoonful or two of gravy or cream. A very large portion of the leaves will be required for a dish, as they shrink exceedingly in the cooking. For a salad, take them very young and serve them entire, or break them quite small with the fingers; then wash and drain them. Dress them with oil and vinegar, or with any other sauce which may be preferred with them.
BOILED TURNIP-RADISHES.
These should be freshly drawn, young and white. Wash and trim them neatly, leaving on two or three of the small inner leaves of the top. Boil them in plenty of salted water from twenty to thirty minutes, and as soon as they are tender send them to table well drained, with melted butter or white sauce. Common radishes when young, tied in bunches, and boiled from eighteen to twenty-five minutes, then served on a toast like asparagus, are very good.
BOILED LEEKS.
Trim off the coarser leaves from some young leeks, cut them into equal lengths, tie them into small bunches, and boil them in plenty of water which has been previously salted and skimmed; serve them on a toast, and send melted butter to table with them.
20 to 25 minutes.
STEWED LETTUCES.
Strip off the outer leaves, and cut away the stalks; wash the lettuces with exceeding nicety, and throw them into water salted as for all green vegetables. When they are quite tender, which will be in from twenty to thirty minutes, according to their age, lift them out and press the water thoroughly from them; chop them a little, and heat them in a clean saucepan with a seasoning of pepper and salt, and a small slice of butter; then dredge in a little flour and stir them well; add next a small cup of broth or gravy, boil them quickly until they are tolerably dry, then stir in a little pale vinegar or lemon-juice, and serve them as hot as possible, with fried sippets round them.
TO BOIL ASPARAGUS.
With a sharp knife scrape the stems of the asparagus lightly but very clean, from within one to two inches of the green tender points; throw them into cold water as they are done, and when all are ready, tie them in bunches of equal size, cut the large ends evenly, that the asparagus may be all of the same length, and put it into plenty of boiling water prepared by the directions of page 309. Cut a round of bread quite half an inch thick, and after having pared off the crust, toast it a delicate brown on both sides. When the stalks of the asparagus are tender, lift it out directly, or it will lose both its colour and its flavour, and will also be liable to break; dip the toast quickly into the water in which it was boiled, and dish the vegetable upon it, with the points meeting in the centre. Send rich melted butter to table with it. In France, a small quantity of vinegar is stirred into the sauce before it is served; and many persons like the addition. Asparagus may be preserved for a day or two sufficiently fresh for use, by keeping the stalks immersed in an inch-depth of cold water; but it is never so good as when dressed directly it is cut, or within a few hours after.
20 to 25 minutes.
Obs.—Abroad, boiled asparagus is very frequently served cold, and eaten with oil and vinegar, or a sauce Mayonnaise.
ASPARAGUS POINTS DRESSED LIKE PEAS. (ENTREMETS.)
This is a convenient mode of dressing asparagus, when it is too small and green to make a good appearance plainly boiled. Cut the points so far only as they are perfectly tender, in bits of equal size, not more than the third of an inch in length; wash them very clean, and throw them into plenty of boiling water, with the usual quantity of salt and a few grains of carbonate of soda. When they are tolerably tender, which will be in from ten to twelve minutes, drain them well, and spread them on a clean cloth; fold it over them, wipe them gently, and when they are quite dry put them into a clean stewpan with a good slice of butter, which should be just dissolved before the asparagus is added; stew them in this over a brisk fire, shaking them often, for eight or ten minutes; dredge in about a small teaspoonful of flour, and add half that quantity of white sugar; then pour in boiling water to nearly cover the asparagus, and boil it rapidly until but little liquid remains: stir in the beaten yolks of two eggs, heap the asparagus high in a dish, and serve it very hot. The sauce should adhere entirely to the vegetable as in green peas à la Française.
TO BOIL GREEN PEAS.
To be eaten in perfection these should be young, very freshly gathered, and shelled just before they are boiled; should there be great inequality in their size, the smaller ones may be separated from the others, and thrown into the saucepan four or five minutes later. Wash, and drain the peas in a cullender, put them into plenty of fast-boiling water, salted by the directions of page 309; keep the pan uncovered, and let them boil rapidly until they are tender; drain them well, dish them quickly, and serve them very hot, with good melted butter in a tureen; or put a slice of fresh butter into the midst of the peas, heap them well over it in the centre of the dish, and let it dissolve before they are disturbed. Never, on any account, boil or mix mint with them unless it be expressly ordered, as it is particularly distasteful to many persons It should be served in small heaps round them, if at all.
15 to 25 minutes, or more if old
GREEN PEAS À LA FRANÇAISE,
OR FRENCH FASHION. (ENTREMETS).
Throw a quart of young and freshly-shelled peas into plenty of spring water with a couple of ounces of butter, and with the hand work them together until the butter adheres well to the peas; lift them out, and drain them in a cullender; put them into a stewpan or thick saucepan without any water, and let them remain over a gentle fire, and be stirred occasionally for twenty minutes from the time of their first beginning to simmer; then pour to them as much boiling water as will just cover them; throw in a small quantity of salt, and keep them boiling quickly for forty minutes: stir well amongst them a small lump of sugar which has been dipped quickly into water, and a thickening of about half an ounce of butter very smoothly mixed with a teaspoonful of flour; shake them over the fire for two minutes, and serve them directly heaped high in a very hot dish; there will be no sauce except that which adheres to the peas if they be properly managed. We have found marrowfats excellent, dressed by this receipt. Fresh and good butter should be used with them always.
Peas, 1 quart; butter, 2 oz.: 20 minutes. Water to cover the peas; little salt: 40 minutes. Sugar, small lump; butter, 1/2 oz.; flour, 1 teaspoonful: 2 minutes.
GREEN PEAS WITH CREAM. (ENTREMETS.)
Boil a quart of young peas perfectly tender in salt and water, and drain them as dry as possible. Dissolve an ounce and a half of butter in a clean stewpan, stir smoothly to it when it boils a dessertspoonful of flour, and shake these over the fire for three or four minutes, but without allowing them to take the slightest colour; pour gradually to them a cup of rich cream, add a small lump of sugar pounded, let the sauce boil, then put in the peas and toss them gently in it until they are very hot: dish, and serve them quickly.
When the beans are very small and young, merely take off the ends and stalks, and drop them into plenty of spring water as they are done; when all are ready wash and drain them well, throw them into a large saucepan of fast-boiling water, salted as usual (see page 309), and when they are quite tender, which will be in from twelve to eighteen minutes, pour them into a cullender, shake the water from them, dish, and send them quickly to table with good melted butter in a tureen. When from half to two parts grown, cut the beans obliquely into a lozenge form, or, when a less modern fashion is preferred, split them lengthwise into delicate strips, and then cut them once across: the strings should be drawn off with the tops and stalks. No mode of dressing it can render this vegetable good when it is old, but if the sides be pared off, the beans cut thin, and boiled tender with rather more than the ordinary proportion of soda, they will be of excellent colour, and tolerably eatable.
FRENCH BEANS À LA FRANÇAISE. (ENTREMETS.)
Boil, and drain them thoroughly; then put them into a clean stewpan, or well-tinned iron saucepan, and shake them over the fire until they are very dry and hot; add to them from two to four ounces of fresh butter cut into small bits, some white pepper, a little salt, and the juice of half a lemon; toss them gently for a few minutes over a clear fire, and serve them very hot. Should the butter turn to oil, a spoonful or two of veal gravy or boiling water must be added.
AN EXCELLENT RECEIPT FOR FRENCH BEANS À LA FRANÇAISE.
Prepare as many young and freshly-gathered beans as will serve for a large dish, boil them tender, and drain the water well from them. Melt a couple of ounces of fresh butter, in a clean saucepan, and stir smoothly to it a small dessertspoonful of flour; keep these well shaken, and gently simmered until they are lightly browned, add salt and pepper, and pour to them by degrees a small cupful of good veal gravy (or, in lieu of this, of sweet rich cream), toss the beans in the sauce until they are as hot as possible; stir quickly in, as they are taken from the fire, the beaten yolks of two fresh eggs, and a little lemon-juice, and serve them without delay. The eggs and lemon are sometimes omitted, and a tablespoonful of minced parsley is added to the butter and flour; but this, we think, is scarcely an improvement.
Beans, 1 to 2 quarts: boiled 15 to 20 minutes. Butter, 2 oz.; flour, 1 dessertspoonful; salt and pepper; veal gravy, small cupful; yolks of eggs, 2; lemon-juice, a dessertspoonful.
TO BOIL WINDSOR BEANS.
When young, freshly gathered, and well dressed, these beans, even with many persons accustomed to a luxurious table, are a favourite accompaniment to a dish of streaked bacon, or delicate pickled pork. Shell them only just before they are wanted, then wash, drain, and throw them into boiling water, salted as for peas. When they are quite tender, pour them into a hot cullender, drain them thoroughly, and send them to table quickly, with a tureen of parsley and butter, or with plain melted butter, when it is preferred. A boiled cheek of bacon, trimmed free of any blackened parts, may be dished over the beans, upon occasion.
20 to 30 minutes; less, when very young.
Obs.—When the skin of the beans appears wrinkled, they will generally be found sufficiently tender to serve, but they should be tasted to ascertain that they are so. This vegetable is often skinned after it is boiled, and then gently tossed up with a little butter before it is dished.