0% found this document useful (0 votes)
4 views38 pages

2013 Lecture Ch0

The document introduces the concepts of decimal and binary numbering systems, explaining their bases and symbols. It covers conversion methods between these systems, including examples of converting binary to decimal and vice versa, as well as hexadecimal conversions. Additionally, it discusses microcontrollers, specifically the features of the PIC18 MCU, and compares it to microprocessors and other microcontroller families.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views38 pages

2013 Lecture Ch0

The document introduces the concepts of decimal and binary numbering systems, explaining their bases and symbols. It covers conversion methods between these systems, including examples of converting binary to decimal and vice versa, as well as hexadecimal conversions. Additionally, it discusses microcontrollers, specifically the features of the PIC18 MCU, and compares it to microprocessors and other microcontroller families.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Chapter 0-1

Introduction to
PIC
Microcontroller
Numbering and Coding systems

Human beings use base 10 (decimal) arithmetic.


Computers use the base 2 (binary) system.

The Binary system is based on powers of two.

0-2
The decimal system (base 10)
The word decimal is derived from the Latin root decem
(ten). In this system the base b = 10 and we use ten symbols

S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

The symbols in this system are often referred to as decimal


digits or just digits.
Integers

Figure 2.1 Place values for an integer in the decimal system


The binary system (base 2)
The word binary is derived from the Latin root bini (or two
by two). In this system the base b = 2 and we use only two
symbols,

S = {0, 1}

The symbols in this system are often referred to as binary


digits or bits (binary digit).
Integers

Figure 2.2 Place values for an integer in the binary system


Conversion

We need to know how to convert a number in one system to


the equivalent number in another system.
Any base to decimal conversion

Figure 2.5 Converting other bases to decimal


Example 2.8
The following shows how to convert the binary number (110.11)2
to decimal: (110.11)2 = 6.75.
Figure 2.7 Converting the integral part of a number in decimal to other bases
Example 2.11

The following shows how to convert 35 in decimal to binary. We


start with the number in decimal, we move to the left while
continuously finding the quotients and the remainder of division
by 2. The result is 35 = (100011)2.
Figure 2.9 Converting the fractional part of a number in decimal to other bases
Example 2.14
Convert the decimal number 0.625 to binary.

Since the number 0.625 = (0.101)2 has no integral part, the


example shows how the fractional part is calculated.
Binary-hexadecimal conversion

Figure 2.10 Binary to hexadecimal and hexadecimal to binary conversion


Example 2.19

Show the hexadecimal equivalent of the binary number


(10011100010)2.

Solution
We first arrange the binary number in 4-bit patterns:

100 1110 0010

Note that the leftmost pattern can have one to four bits. We then
use the equivalent of each pattern shown in Table 2.2 on page 25
to change the number to hexadecimal: (4E2)16.
Example 2.20

What is the binary equivalent of (24C)16?

Solution
Each hexadecimal digit is converted to 4-bit patterns:

2 → 0010, 4 → 0100, and C → 1100

The result is (001001001100)2.


ASCII Codes

Figure 0-1. Selected ASCII Codes

0-17
Digital Primer

Figure 0-2. Binary Signals

0-18
A pictorial representation of AND, OR, XOR,
and NOT gates as well as their input and
output values

0-19
Two Implementations of a Half-
Adder
Block Diagram of a Half-Adder
Full-Adder Built From a Half-Adder
3-Bit Adder Using Three Full-
Adders
Address Decoders
Constructing a flip-flop

0-25
D Flip-Flops
Inside the Computer
Memory cells arranged by address

0-28
Internal Organization of a
Computer
Internal Block Diagram of a CPU
Figure 2.8 The machine cycle

© 2007
Pearson
Addison-
Wesley.
All rights
0-31
reserved
Microprocessor vs. microcontroller
(MCU)

• Microprocessor
– A processor implemented on a very large scale integration
(VLSI) chip
– Peripheral chips are needed to construct a product
• Microcontroller
– The processor and peripheral functions implemented on one
VLSI chip
• Embedded systems
• SOC (system on chip)
32
Microprocessor vs. microcontroller
(MCU)

33
Simplified view of a PIC
microcontroller

34
PIC microcontroller vs. Intel MCS-51 (8051)

 "Peripheral Interface Controller" made by Microchip


Technology

 8-bit ALU
 Intel's original in the 1980s.
 Several companies offer MCS-51 as IP cores in FPGAs or
ASICs.
68HC MCU and AVR

 68HC microcontroller
 8-bit microcontroller family introduced by Motorola in 1985.
Now produced by Freescale Semiconductor
 CISC (complex instruction set computer) design

 AVR
 8-bit RISC MCU was sold to Atmel from Nordic VLSI

36
Features of PIC18 MCU

• 8-bit CPU
• Program ROM (read-only memory)
– UV-EROM (erasable programmable ROM): need 20 minutes to erase
– Flash (Electrical EPROM, EEPROM)
– OTP (one-time-programmable) version: mass production
– Masked version: burning program during IC fabrication
• Data RAM (random access memory)
– A maximum of 4096 bytes
– Some PIC18s use EEPROM to store critical data that are not changed not often.

37
Features of PIC18 MCU

• Timers
• Pulse-width modulation (PWM)
• Parallel I/O ports
• SPI, I2C, controller area network (CAN) serial interface
• Universal asynchronous receiver transmitter (UART)
• 10-bit A/D converter

38

You might also like