Eng.Samra Essalaimeh Philadelphia University 2013/2014 2 nd Semester PIC Microcontrollers.
-
Upload
brent-blake -
Category
Documents
-
view
213 -
download
0
Transcript of Eng.Samra Essalaimeh Philadelphia University 2013/2014 2 nd Semester PIC Microcontrollers.
Eng .Samra EssalaimehEng .Samra EssalaimehPhiladelphia UniversityPhiladelphia University
2013/20142nd Semester
PIC MicrocontrollersPIC Microcontrollers
Computer Systems
The PC system main unit.
PC motherboard
Block diagram of PC motherboard.
Word processor Operation
PC Microprocessor System
Block diagram of PC microprocessor system.
System Operation
•Program ExecutionThe ROM and RAM memory contain program information and data in numbered locations.The ISD contains address decoding logic which allocates a particular memory chip to a range of addresses. The I/O port registers, which are set up to handle the data transfer in and out ofthe system, are also allocated particular addresses by the system designer, and accessed by the CPU in the same way as memory locations.
•Execution Cycle
PC Engineering Applications
The MicrocontrollerThe microcontroller can provide, in a
simplified form, all the main elements of the conventional microprocessor system on a single chip.
less complex applications can be designed and built quickly and cheaply
A Microcontroller Application
Microcontroller keypad display system
Programming a Microcontroller
Information CodingNumber Systems: 1.Decimal: Base 10
2. Binary: Base 2
3. Hexadecimal: Base 16
hexadecimal is used as a way to represent binary numbers in a compact way, while allowing easy conversion back to the original binary
Examples of equivalent values
Counting:The rules for counting in any number system:1.Start with all digits set to zero.2. In the right digit position (LSB), count up from zero to the maximum digit available (1 in binary, 9 in decimal, F in hexadecimal). 3. If a column value is at its maximum, reset it to zero, and increment (add 1 to) the next column to the left.In microprocessors, there is a fixed number of digits in the registers which store binary numbers (8, 16, 32 bits or more). If the number storage space has a fixed number of digits, leading zeros must be used to fill the empty positions, because each register bit must be either 1 or 0, and leading zeros do not alter the value.
Bits, Bytes and Words:
One binary digit represents a ‘bit’ of information. A group of 8 bits is called a ‘byte’, and larger binary codes are called ‘words’. This last term is used fairly loosely, but it sometimes refers to a 16-bit code, with a 32-bit code called a ‘long word’, specifically in the Motorola 68000 CPU, which was widely used in the past. As we now know, in hexadecimal four bits are represented by one hex digit, so a byte is 2 hex digits, and so on. Thus, register and memory values are typically displayed as hexadecimal numbers with 2, 4, 8, 16 . . . digits.
Machine Code ProgramsData Words:
Machine Code
8086 Machine Code
PIC Machine Code
ASCII Code:ASCII (American standard code for information interchange)
is a type of binary code for representing alphanumeric characters, as found on your computer keyboard.
The basic code consists of seven bits. For example, capital (or ‘upper case’) ‘A’ is represented by binary code
100 0001 (65), ‘B’ by 66, and so on to ‘Z’ = 65+25 = 90 = 101 10102. Lower case letters
and other common keyboard characters such as punctuation, brackets and arithmetic signs, plus some special control characters also have a code in the range 0–127. The numerical characters also have a code, for example ‘9’ = 011 10012, so you sometimes need to make it clear if the code is the binary equivalent 10012 or the ASCII code 011 10012.