Microcontroller Programming
eBook - ePub

Microcontroller Programming

The Microchip PIC

Julio Sanchez, Maria P. Canton

  1. 824 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Microcontroller Programming

The Microchip PIC

Julio Sanchez, Maria P. Canton

Book details
Book preview
Table of contents
Citations

About This Book

From cell phones and television remote controls to automobile engines and spacecraft, microcontrollers are everywhere. Programming these prolific devices is a much more involved and integrated task than it is for general-purpose microprocessors; microcontroller programmers must be fluent in application development, systems programming, and I/O operation as well as memory management and system timing. Using the popular and pervasive mid-range 8-bit Microchip PICĀ® as an archetype, Microcontroller Programming offers a self-contained presentation of the multidisciplinary tools needed to design and implement modern embedded systems and microcontrollers. The authors begin with basic electronics, number systems, and data concepts followed by digital logic, arithmetic, conversions, circuits, and circuit components to build a firm background in the computer science and electronics fundamentals involved in programming microcontrollers.For the remainder of the book, they focus on PIC architecture and programming tools and work systematically through programming various functions, modules, and devices. Helpful appendices supply the full mid-range PIC instruction set as well as additional programming solutions, a guide to resistor color codes, and a concise method for building custom circuit boards.Providing just the right mix of theory and practical guidance, Microcontroller Programming: The Microchip PICĀ® is the ideal tool for any amateur or professional designing and implementing stand-alone systems for a wide variety of applications.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Microcontroller Programming an online PDF/ePUB?
Yes, you can access Microcontroller Programming by Julio Sanchez, Maria P. Canton in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Engineering. We have over one million books available in our catalogue for you to explore.

Information

Publisher
CRC Press
Year
2018
ISBN
9781351837811
Edition
1
Chapter 1
Basic Electronics
1.0 The Atom
Until the end of the nineteenth century it was assumed that matter was composed of small, indivisible particles called atoms. The work of J.J. Thompson, Daniel Rutheford, and Neils Bohr proved that atoms were complex structures that contained both positive and negative particles. The positive ones were called protons and the negative ones electrons.
Several models of the atom were proposed: the one by Thompson assumed that there were equal numbers of protons and electrons inside the atom and that these elements were scattered at random, as in the leftmost drawing in Figure 1-1. Later, in 1913, Daniel Ruthefordā€™s experiments led him to believe that atoms contained a heavy central positive nucleus with the electrons scattered randomly. So he modified Thompsonā€™s model as shown in the center drawing. Finally, Neils Bohr theorized that electrons had different energy levels, as if they moved around the nucleus in different orbits, like planets around a sun. The rightmost drawing represents this orbital model.
Image
Figure 1-1 Models of the Atom
Investigations also showed that the normal atom is electrically neutral. Protons (positively charged particles) have a mass of 1.673 Ɨ 10āˆ’24 grams. Electrons (negatively charged particles) have a mass of 9.109 Ɨ 10āˆ’28 grams. Furthermore, the orbital model of the atom is not actually valid since orbits have little meaning at the atomic level. A more accurate representation is based on concentric spherical shells about the nucleus. An active area of research deals with atomic and sub-atomic structures.
The number of protons in an atom determines its atomic number; for example, the hydrogen atom has a single proton and an atomic number of 1, helium has 2 protons, carbon has 6, and uranium has 92. But when we compare the ratio of mass to electrical charge in different atoms we find that the nucleus must be made up of more than protons. For example, the helium nucleus has twice the charge of the hydrogen nucleus, but four times the mass. The additional mass is explained by assuming that there is another particle in the nucleus, called a neutron, which has the same mass as the proton but no electrical charge. Figure 1-2 shows a model of the helium atom with two protons, two electrons, and two neutrons.
Image
Figure 1-2 Model of the Helium Atom
1.1 Isotopes and Ions
But nature is not always consistent with such neat models. Whereas in a neutral atom, the number of protons in the atomic nucleus exactly matches the number of electrons, the number of protons need not match the number of neutrons. For example, most hydrogen atoms have a single proton, but no neutrons, while a small percentage have one neutron, and an even smaller one have two neutrons. In this sense, atoms of an element that contains different number of neutrons are isotopes of the element; for example water (H2O) containing hydrogen atoms with two neutrons (deuterium) is called ā€œheavy water.ā€
An atom that is electrically charged due to an excess or deficiency of electrons is called an ion. When the dislodged elements are one or more electrons the atom takes a positive charge. In this case it is called a positive ion. When a stray electron combines with a normal atom the result is called a negative ion.
1.2 Static Electricity
Free electrons can travel through matter or remain at rest on a surface. When electrons are at rest, the surface is said to have a static electrical charge that can be positive or negative. When electrons are moving in a stream-like manner we call this movement an electrical current. Electrons can be removed from a surface by means of friction, heat, light, or a chemical reaction. In this case the surface becomes positively charged.
The ancient Greeks discovered that when amber was rubbed with wool the amber became electrically charged and would attract small pieces of material. In this case, the charge is a positive one. Friction can cause other materials, such as hard rubber or plastic, to become negatively charged. Observing objects that have positive and negative charges we note that like charges repel and unlike charges attract each other, as shown in Figure 1-3.
Image
Figure 1-3 Like and Unlike Charges
Friction causes loosely-held electrons to be transferred from one surface to the other. This results in a net negative charge on the surface that has gained electrons, and a net positive charge on the surface that has lost electrons. If there is no path for the electrons to take to restore the balance of electrical charges, these charges remain until they gradually leak off. If the electrical charge continues building it eventually reaches the point where it can no longer be contained. In this case it discharges itself over any available path, as is the case with lightning.
Static electricity does not move from one place to another. While some interesting experiments can be performed with it, it does not serve the practical purpose of providing energy to do sustained work.
Static electricity certainly exists, and under certain circumstances we must allow for it and account for its possible presence, but it will not be the main theme of these pages.
1.3 Electrical Charge
Physicists often resort to models and theories to describe and represent some force that can be measured in the real world. But very often these models and representations are no more than concepts that fail to physically represent the object. In this sense, no one knows exactly what gravity is, or what is an electrical charge. Gravity, which can be felt and measured, is the force between masses.
By the same token, bodies in ā€œcertain electrical conditionsā€ also exert measurable forces on one another. The term ā€œelectrical chargeā€ was coined to explain these observations.
Three simple postulates or assumptions serve to explain all electrical phenomena:
1. Electrical charge exists and can be measured. Charge is measured in Coulombs, a unit named for the French scientist Charles Agustin Coulomb.
2. Charge can be positive or negative.
3. Charge can neither be created nor destroyed. If two objects with equal amounts of positive and negative charge are combined on some object, the resulting object will be electrically neutral and will have zero net charge.
1.3.1 Voltage
Objects with opposite charges attract, that is, they exert a force upon each other that pulls them together. In this case, the magnitude of the force is proportional to the product of the charge on each mass. Like gravity, electrical force depends inversely on the distance squared between the two bodies; the closer the bodies the greater the force. Consequently, it takes energy to pull apart objects that are positively and negatively charged, in the same manner that it takes energy to raise a big mass against the pull of gravity.
The potential that separate objects with opposite charges have for doing work is called voltage. Voltage is measured in units of volts (V). The unit is named for the Italian scientist Alessandro Volta.
The greater the charge and the greater the separation, the greater the stored energy, or voltage. By the same token, the greater the voltage, the greater the force that drives the charges together.
Voltage is always measured between two points that represent the positive and negative charges. In order to compare voltages of several charged bodies a common reference point is necessary. This point is usually called ā€œground.ā€
1.3.2 Current
Electrical charge flows freely in certain materials, called conductors, but not in others, called insulators. Metals and a few other elements an...

Table of contents

Citation styles for Microcontroller Programming

APA 6 Citation

Sanchez, J., & Canton, M. (2018). Microcontroller Programming (1st ed.). CRC Press. Retrieved from https://www.perlego.com/book/1485426/microcontroller-programming-the-microchip-pic-pdf (Original work published 2018)

Chicago Citation

Sanchez, Julio, and Maria Canton. (2018) 2018. Microcontroller Programming. 1st ed. CRC Press. https://www.perlego.com/book/1485426/microcontroller-programming-the-microchip-pic-pdf.

Harvard Citation

Sanchez, J. and Canton, M. (2018) Microcontroller Programming. 1st edn. CRC Press. Available at: https://www.perlego.com/book/1485426/microcontroller-programming-the-microchip-pic-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Sanchez, Julio, and Maria Canton. Microcontroller Programming. 1st ed. CRC Press, 2018. Web. 14 Oct. 2022.