PIC18F452 8-bit PIC Microcontroller
PIC18F452 is an 8-bit with 10 MIPS, CMPS, FLASH-based microcontroller that has 34 I/O pins out of 40 Pin packages. It is a powerful microcontroller with one 8-bit and three 16-bit timers, 8-Channels 10-bit Analog-digital converter, and I2C, SPI, USART peripheral. It is a Low power microcontroller unit that consumes about less than 0.2 uA standby current and 1.6mA normal current during 5V and 4 Mhz operations.
PIC18F452 Pin Configuration
Pin Number |
Pin Name |
Description |
1 |
MCLR/VPP |
Master Clear (input) or High voltage ICSP programming enable pin mainly used for programming purposes. |
2 |
RA0/AN0 |
Bidirectional I/O pin of Port A bit 0 or Analog input 0 |
3 |
RA1/AN1 |
Bidirectional I/O pin of Port A bit 1 or Analog input 1 |
4 |
RA2/AN2/VREF- |
Bidirectional I/O pin of Port A bit 2 or Analog input 2 or A/D Reference (Low) Voltage. |
5 |
RA3/AN3/VREF+ |
Bidirectional I/O pin of Port A bit 3 or Analog input 3 or A/D Reference (High) Voltage. |
6 |
RA4/T0CKI |
Bidirectional I/O pin of Port A bit 4 or Timer 0 external clock input. |
7 |
RA5/AN4/SS/LVDIN |
Bidirectional I/O pin of Port A bit 5 or Analog input 4 or SPI Slave Select input or Low voltage Detect input. |
8 |
RE0/RD/AN5 |
Bidirectional I/O pin of Port E bit 0 or Read control for parallel slave port or Analog input 5 |
9 |
RE1/WR/AN6 |
Bidirectional I/O pin of Port E bit 1 or Write control for parallel slave port or Analog input 6 |
10 |
RE2/CS/AN7 |
Bidirectional I/O pin of Port E bit 2 or Chip select control for parallel slave port or Analog input 7. |
11 |
VSS |
Positive supply pin. |
12 |
VDD |
Ground supply pin. |
13 |
OSC1/CLKI |
Oscillator Crystal or External clock input. |
14 |
OSC2/CLKO/RA6 |
Bidirectional I/O pin of Port A bit 6 or Oscillator crystal or clock output. |
15 |
RC0/T1OSO/T1CKI
|
Bidirectional I/O pin of Port C bit 0 or Timer 1 Oscillator output or Timer 1/Timer 3 external clock input. |
16 |
RC1/T1OSI/CCP2
|
Bidirectional I/O pin of Port C bit 1 or Timer 1 Oscillator input or Capture 2 input, Capture 2 output, PWM 2 output. |
17 |
RC2/CCP1 |
Bidirectional I/O pin of Port C bit 2 or Capture 1 input, Capture1 output, PWM1 output |
18 |
RC3/SCK/SCL |
Bidirectional I/O pin of Port C bit 3 or Synchronous serial clock input/output for SPI mode or Synchronous serial clock input/output for 12C mode. |
19 |
RD0/PSP0
|
Bidirectional I/O pin of Port D bit 0 or Parallel slave Port Data |
20 |
RD1/PSP1 |
Bidirectional I/O pin of Port D bit 1 or Parallel slave Port Data. |
21 |
RD2/PSP2 |
Bidirectional I/O pin of Port D bit 2 or Parallel slave Port Data |
22 |
RD3/PSP3 |
Bidirectional I/O pin of Port D bit 3 or Parallel slave Port Data |
23 |
RC4/SDI/SDA |
Bidirectional I/O pin of Port C bit 4 or SPI Data In or 12C data I/O. |
24 |
RC5/SDO |
Bidirectional I/O pin of Port C bit 5 or SPI Data Out. |
25 |
RC6/TX/CK |
Bidirectional I/O pin of Port C bit 6 or USART Asynchronous Transmit or USART Synchronous Clock |
26 |
RC7/RX/DT
|
Bidirectional I/O pin of Port C bit 7 or USART Asynchronous Receive or USART Synchronous Data |
27 |
RD4/PSP4 |
Bidirectional I/O pin of Port D bit 4 or Parallel slave Port Data |
28 |
RD5/PSP5 |
Bidirectional I/O pin of Port D bit 5 or Parallel slave Port Data |
29 |
RD6/PSP6 |
Bidirectional I/O pin of Port D bit 6 or Parallel slave Port Data |
30 |
RD7/PSP7 |
Bidirectional I/O pin of Port D bit 7 or Parallel slave Port Data |
31 |
VSS |
Ground Supply pin |
32 |
VDD |
Positive supply pin |
33 |
RB0/INT0 |
Bidirectional I/O pin of Port B bit 0 or External Interrupt 0. |
34 |
RB1/INT1 |
Bidirectional I/O pin of Port B bit 1 or External Interrupt 1. |
35 |
RB2/INT2 |
Bidirectional I/O pin of Port B bit 2 or External Interrupt 2. |
36 |
RB3/CCP2 |
Bidirectional I/O pin of Port B bit 3 or Capture 2 input, Compare 2 output, PWM 2 output. |
37 |
RB4
|
Bidirectional I/O pin of Port B bit 4 with IOC (Interrupt-on-change) |
38 |
RB5/PGN |
Bidirectional I/O pin of Port B bit 5 with IOC (Interrupt-on-change) or Low Voltage ICSP programming enable pin |
39 |
RB6/PG |
Bidirectional I/O pin of Port B bit 6 with IOC (Interrupt-on-change) or In-Circuit Debugger and ICSP programming clock pin. |
40 |
RB7/PGD |
Bidirectional I/O pin of Port B bit 7 with IOC (Interrupt-on-change) or In-Circuit Debugger and ICSP programming data pin. |
Features and Specification of the PIC18F452 Microcontroller
PIC18F452 - Simplified Features and Specification |
|
CPU |
8-bit |
Number of Pins |
40 |
Operating Voltage (V) |
2-5.5 V |
Number of I/O pins |
34 |
ADC Module |
1 (8-Channels, 10-bits) |
Timer Module |
8-bit(1), 16-bit(3) |
Comparators |
0 |
DAC Module |
0 |
Communication Peripherals |
SPI, I2C, UART |
External Oscillator |
Yes |
Internal Oscillator |
No |
Program Memory (KB) |
32KB |
CPU Speed (MIPS) |
10 |
RAM Bytes |
1536 byte |
Data EEPROM |
256 byte |
Note: Complete technical details can be found in the 18F452 Datasheet linked at the bottom of this page.
Alternative product of PIC18F452
Alternative products for PIC18F452 microcontroller are listed below-
- PIC12F629
- PIC12F683
- PIC16F505
- PIC12F508
- PIC16F676
- PIC16F72
- PIC16F873A
- PIC16F876A
- PIC16F886
- PIC16F252
Introduction to PIC18F452
PIC18F452 is an 8-bit with 10 MIPS, CMPS, FLASH-based microcontroller that has 34 I/O pins out of 40 Pin packages. It is a powerful microcontroller with one 8-bit and three 16-bit timers, 8-Channels 10-bit Analog-digital converter, and I2C, SPI, USART peripheral. It is a Low power microcontroller unit that consumes about less than 0.2 uA standby current and 1.6mA normal current during 5V and 4 Mhz operations.
PIC18F452 also has the feature of Programming code protection, Power-on Reset (POR), Power-up Timer (PWRT), Oscillator Start-up timer with power saving sleep mode. The watchdog timer features its own On-Chip RC Oscillator for reliable operations. 2V to 5.5V operating voltage makes the 18F452 suitable for 3.3V and 5.0V logic level operations. Below image is showing the pin diagram of PIC18F452-
Detailed Features of PIC18F452
PIC18F452 –Detailed Features |
|
CPU |
8-bit |
Architecture |
8-bit |
Program Memory Size (Kbytes) |
32 KB |
RAM (bytes) |
1536 bytes |
EEPROM/HEF |
256 byte |
Pin Count |
40 |
Max. CPU Speed (MHz) |
40MHz |
Peripheral Pin Select (PPS) |
No |
Internal Oscillator |
No |
No. Of comparators |
Nil |
No. Of Operational Amplifier |
Nil |
No. Of ADC channels |
8 |
Max ADC Resolution (bits) |
10-bits |
ADC with Computation |
No |
Number of DAC Converter |
Nil |
Max DAC resolution |
- |
Internal Voltage Reference |
No |
Zero Cross Detect |
No |
No. Of 8-bit timers |
1 |
No. Of 16-bit Timers |
3 |
Signal Measurement Timer |
No |
Hardware Limit Timer |
No |
No. Of PWM outputs |
2 |
Max PWM resolution |
8-bit |
Angular Timer |
No |
Math Accelerator |
No |
No. Of UART module |
1 |
No. Of SPI Module |
1 |
No. Of I2C module |
1 |
No. Of USB Module |
Nil |
Windowed Watchdog Timer (WWDT) |
No |
CRC/Scan |
No |
Numerically Controlled Oscillator |
No |
Cap. Touch Channels |
Nil |
Segment LCD |
No |
Minimum Operating Temperature (*C) |
-40°C |
Maximum Operating Temperature (*C) |
125°C |
Minimum Operating Voltage (V) |
2V |
Maximum Operating Voltage (V) |
5.5 V |
High Voltage Capable |
No |
Programming PIC Microcontroller
PIC microcontrollers can be programmed with different software that is available in the market. There are people who still use Assembly language to program PIC MCUs. The below details is for the most advanced and common software and compiler that has been developed by Microchip itself.
In order to program the PIC microcontroller, we will need an IDE (Integrated Development Environment), where the programming takes place. A compiler, where our program gets converted into MCU readable form called HEX files. An IPE (Integrated Programming Environment), which is used to dump our hex file into our PIC MCUs.
IDE: MPLABX v3.35
IPE: MPLAB IPE v3.35
Compiler: XC8
Microchip has given all these three software for free. They can be downloaded directly from their official page. I have also provided the link for your convenience. Once downloaded, install them on your computer. If you have any problem doing so, you can post them on the comment below.
To dump or upload our code into PIC, we will need a device called PICkit 3. The PICkit 3 programmer/debugger is a simple, low-cost in-circuit debugger that is controlled by a PC running MPLAB IDE (v8.20 or greater) software on a Windows platform. The PICkit 3 programmer/debugger is an integral part of the development engineer's tool suite. A basic programming circuit for PIC18F452 is given below.
In addition to this, we will also need other hardware like a Perf board or breadboard, Soldering station, PIC ICs, Crystal oscillators, capacitors, etc.
Components associated with PIC
PICkit3, PIC Development Board, Crystal Oscillators, Capacitors, 12V Adapter, 7805 Voltage Regulator.
Application of PIC18F452
This is a basic Mid-range 8-bit microcontroller unit that can be used in the following applications-
- Input-Output operations
- Control Applications
- Analog data Processing
- Sensors integration and data logging
- Small scale, low cost embedded application based production
2D Model
The dimensions of the PIC18F452 are shown below-