Teach Yourself PIC Microcontrollers | www.electronicspk.com | 11
used
to reset the microcontroller, like soft-boot. As well as to put the microcontroller into programming
mode. The MCLR pin when connected to ground, will reset the microcontroller, and keep it in reset state,
till the ground connection is released. After that the microcontroller will have all its RAM reset, and
program execution
will begin, just like the system has been just powered on. A 10K pull up resistor is
usually connected with the pin, to keep it high when reset switch is released.
The same pin will also work as program mode pin. When a new software is to be downloaded into the
microchip, about 12V are applied to the MCLR pin, by your programming device. This can be done right in
your circuit, or by taking the IC out of circuit and putting it into the IC socket on your programmer. We
shall talk more about this in section on programming. The 10K resistor is then useful to avoid 12V
reaching
VCC and therefore to other devices.
Analog and Digital Data
Our microprocessors use digital data to represent everything. Even music, videos and images all are
represented as digital data, which is a series of logical ‘0’ and ‘1’. However our real world data is not
digital. It is rather analog. It is rightly said, “We live
in an analog world, but process the data in digital
world”. Real world data like light, temperature, pressure, heat, height, distance, speed, force etc. all are
analog data. In order to utilize these data we have to acquire them with specific sensors or transducers and
then convert into digital format for use within microprocessor’s digital world.
Many other microcontrollers
require an external ADC chip to implement this, however this feature has been nicely built into PIC
microcontrollers. The number of Analog channels will vary among devices and some devices will not have
this feature on-board. Pins labeled as AN0, AN1 etc are for analog data if required, however they can also
function as normal digital pins to work with digital data. As previously said this
selection is made by
configuring specific registers in microcontroller.
BASIC CONCEPTS
Did you know that all people can be classified
into one of 10 groups- those who are familiar
with binary number system and those who are
not familiar with it. You don’t understand? That
means that you still belong to the later group. If
you want to change your status read the
following text. Text
describing briefly some of
the basic concepts used further in this book (just
to be sure that we discuss the same issues).
Chia sẻ với bạn bè của bạn: