2 Pic18f452
2 Pic18f452
2 Pic18f452
330_02
Microcontroller Unit
330_02
330_02
Microprocessor Unit
Includes Arithmetic Logic Unit (ALU), Registers, and Control Unit
Instruction decoder
16-bit instructions
330_02
Microprocessor Unit
Registers
Control unit
330_02
Addressing capacity: 2 MB
Addressing capacity: 4 KB
330_02
16-bit instruction/data bus for Program Memory 8-bit data bus for Data Memory
Read and Write
Control signals
330_02
PIC18F452/4520 Memory
Program Memory: 32 K
Data Memory: 4 K
Data EEPROM
330_02
PIC18F452/4520 Memory
Program Memory Data Memory
330_02
10
330_02
11
PORT A through PORT E Most I/O pins are multiplexed Generally have eight I/O pins Addresses already assigned to these ports Each port is identified by its assigned SFR
330_02
12
330_02
13
Data Transfer
330_02
14
Serial Communications
330_02
16
330_02
17
18
330_02
19
330_02
20
PIC18F Instructions
77 assembly language instructions
330_02
21
Instruction Descriptions
Copy (Move) 8-bit number (Literal) into W register
0000 1110 XXXX XXXX (any 8-bit number) Copy (Move) contents of W register into PORTC (File)
Binary format:
330_02
22
Illustrative Program
Problem statement:
Hardware:
330_02
23
Illustration
Interfacing LEDs to PORTC
330_02
24
Illustration
Program (software)
Logic 0 to TRISC sets up PORTC as an output port Byte 55H turns on alternate LEDs
;Load W register with 0 ;Set up PORTC as output ;Byte 55H to turn on LEDS ;Turn on LEDs ;Power down
330_02
25
Illustration
Address 000000 Hex 0E00 Mnemonics MOVLW 00 Comments ;Load W with 0s
000002
000004 000006 000008
6E94
0E55 6E82 0003
MOVWF TRISC
MOVLW 0x55 MOVWF PORTC SLEEP
330_02
26
Illustration
Execution of the instruction: MOVWF PORTC
330_02
27
330_02
28
Embedded System
Microcontroller-based Time and Temperature System
330_02
29