PIC18F4320-I/P - 8-Bit 40MHz 8KB Flash MCU 40-PDIP | Microchip
Référence : PIC18F4320-I/P ✓ Actif| Qté | Prix unitaire | Total |
|---|---|---|
| 1 | $6.3 | $6,30 |
| 10 | $5.75 | $57,50 |
| 100 | $5.2 | $520,00 |
| 500 | $4.6 | $2 300,00 |
| 1 000 | $4.05 | $4 050,00 |
PIC18F4320-I/P Présentation
What is a PIC microcontroller? A Microcontroller Unit (MCU) is a single-chip computer that integrates a CPU core, program memory, working RAM, non-volatile storage, and a rich set of peripherals (ADC, timers, communications, comparators). PIC microcontrollers from Microchip use a Harvard RISC architecture that separates program and data buses, allowing simultaneous fetch and execute of instructions and producing deterministic interrupt latency that is widely favored in real-time control. The PIC18 series extends PIC16 code with 16-bit instructions, linear memory, and C-compiler friendly extensions that simplify firmware development using MPLAB XC8 and the free MPLAB IDE toolchain.
Key features include 256 bytes of EEPROM, self-programming capability for in-application firmware updates, an ICD (In-Circuit Debugger) interface, two CCP modules for capture/compare/PWM, a 10-bit Analog-to-Digital Converter with up to 13 input channels, two analog comparators, and a Master Synchronous Serial Port configurable as 3-wire SPI or 2-wire I2C. The nanoWatt Technology power-management suite provides multiple idle and sleep modes that drop run currents below typical values for battery-friendly designs. With 36 digital I/O on the 40-pin variant, the PIC18F4320-I/P delivers a higher pin density than the 28-pin members of the family while sharing the same PIC18 core, peripheral set, and toolchain.
Architecturally the device uses an enhanced 8-bit CPU with 77 single-word instructions, hardware multiplier, and prioritized interrupts with shadow registers. Memory is organized as a 16-bit-wide program Flash accessed through a 21-bit PC, plus 16-bit-wide file-register SRAM. Brown-out Reset, Watchdog Timer with its own on-chip RC oscillator, and a wide operating-voltage range protect against supply glitches and code runaway in unattended installations.
Typical applications include industrial automation and process control nodes, sensor signal conditioning with the 10-bit ADC, motor control using CCP PWM outputs, automotive body and interior subsystems on 12 V buses (down-regulated), low-power remote sensor platforms, educational and hobbyist development boards, and USB/serial bridge firmware for legacy serial peripherals. The through-hole 40-pin PDIP is also widely used in breadboard prototyping and educational labs where SOIC/QFN parts are inconvenient.
A key design consideration is that the PIC18F4320 family is mature and the -I/P variant is preferred over the -E/P extended-temperature variant for industrial-cost applications; for newer designs with more memory or peripherals, Microchip recommends the PIC18F46K22, PIC18F46K40, or PIC18F46Q10 families, which are software-compatible and pin-compatible in many cases while consuming less power and adding PPS (Peripheral Pin Select).
This page synthesizes distributor pricing, drop-in PIC18F-family alternatives, and practical design notes drawn from Microchip datasheet DS39582B and the PIC18F4320 product page.
Alternatives de remplacement direct pour PIC18F4320-I/P — même boîtier, compatible broche à broche. Les références à boîtier différent nécessitant une retouche du PCB sont exclues.
Variantes de cette série
Modèles de la même série directement compatibles avec PIC18F4320-I/P (même facteur de forme et même empreinte) — différant par Package, Operating Temperature, Timers, ADC, Core.
Outil de comparaison rapide — sélectionnez des références alternatives pour une comparaison côte à côte :
PIC18F4520-I/P
✅ Remplacement direct✓ En stock
$5.35 / unité
Voir la fiche technique →PIC18F4420-I/P
✅ Remplacement direct📋 Alternative de référence (hors catalogue)
PIC18F4620-I/P
✅ Remplacement direct✓ En stock
$5.08 / unité
Voir la fiche technique →PIC18F46K22-I/P
✅ Remplacement direct✓ En stock
$2.61 / unité
Voir la fiche technique →PIC18F46K40-I/P
✅ Remplacement direct✓ En stock
$2.4 / unité
Voir la fiche technique →PIC18F4220-I/P
✅ Remplacement direct ⚠️ Spécifications non vérifiées✓ En stock
$4.78 / unité
Voir la fiche technique →PIC18F4320-I/P Valeurs maximales et caractéristiques électriques
| Core | PIC18 (8-bit RISC, Harvard) |
| CPU Instruction Set | 77 single-word instructions |
| Maximum CPU Speed | 40 MHz (10 MIPS) |
| Program Memory (Flash) | 8 KB (4K x 16) |
| Data SRAM | 512 bytes |
| Data EEPROM | 256 bytes |
| Operating Voltage Range | 2.0 V to 5.5 V |
| Digital I/O Pins | 36 |
| A/D Converter | 10-bit, up to 13 channels |
| Comparators | 2 analog comparators |
| CCP / PWM Modules | 2 CCP |
| Communication | MSSP (SPI/I2C), USART |
| Timers | 4 (Timer0/1/2/3) |
| Self-Programming | Yes |
| In-Circuit Debug | ICD |
| Brown-out Reset / WDT | Yes / Yes |
| Température de fonctionnement | -40 C to +85 C (Industrial, I suffix) |
| Boîtier | 40-pin PDIP (0.600 in / 15.24 mm) |
| Type de montage | Through-Hole |
| Niveau MSL | 1 (not moisture-sensitive for PDIP) |
| Statut RoHS | Compliant |
Configuration des broches de PIC18F4320-I/P
| Broche 1 | MCLR/VPP — Master Clear (Reset) input or programming voltage |
| Broche 2 | RA0/AN0 — PORTA bit 0 / Analog input 0 |
| Broche 3 | RA1/AN1 — PORTA bit 1 / Analog input 1 |
| Broche 4 | RA2/AN2/VREF- — PORTA bit 2 / Analog input 2 / ADC VREF- |
| Broche 5 | RA3/AN3/VREF+ — PORTA bit 3 / Analog input 3 / ADC VREF+ |
| Broche 6 | RA4/T0CKI — PORTA bit 4 / Timer0 clock input |
| Broche 7 | RA5/AN4/SS — PORTA bit 5 / Analog input 4 / SPI Slave Select |
| Broche 8 | OSC1/CLKI — Oscillator crystal input / external clock in |
| Broche 9 | OSC2/CLKO — Oscillator crystal output / clock out |
| Broche 10 | RC0/T1OSO/T1CKI — PORTC bit 0 / Timer1 oscillator output / Timer1 clock |
| Broche 11 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator in / CCP2 |
| Broche 12 | RC2/CCP1 — PORTC bit 2 / CCP1 (PWM output) |
| Broche 13 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| Broche 14 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| Broche 15 | RC5/SDO — PORTC bit 5 / SPI data out |
| Broche 16 | RC6/TX/CK — PORTC bit 6 / USART TX / USART clock |
| Broche 17 | RC7/RX/DT — PORTC bit 7 / USART RX / USART data |
| Broche 18 | VSS — Ground |
| Broche 19 | VDD — Positive supply (+2.0 V to +5.5 V) |
| Broche 20 | RB0/INT0 — PORTB bit 0 / External interrupt 0 |
| Broche 21 | RB1/INT1 — PORTB bit 1 / External interrupt 1 |
| Broche 22 | RB2/INT2 — PORTB bit 2 / External interrupt 2 |
| Broche 23 | RB3/CCP2 — PORTB bit 3 / CCP2 (alternate) |
| Broche 24 | RB4 — PORTB bit 4 (interrupt-on-change) |
| Broche 25 | RB5 — PORTB bit 5 (interrupt-on-change) |
| Broche 26 | RB6/PGC — PORTB bit 6 / ICSP clock |
| Broche 27 | RB7/PGD — PORTB bit 7 / ICSP data |
| Broche 28 | RE0/RD/AN5 — PORTE bit 0 / parallel slave read / Analog input 5 |
| Broche 29 | RE1/WR/AN6 — PORTE bit 1 / parallel slave write / Analog input 6 |
| Broche 30 | RE2/CS/AN7 — PORTE bit 2 / parallel slave chip select / Analog input 7 |
| Broche 31 | VDD — Positive supply (second VDD pin) |
| Broche 32 | VSS — Ground (second VSS pin) |
| Broche 33 | RA6 — PORTA bit 6 |
| Broche 34 | RA7 — PORTA bit 7 |
| Broche 35 | RC0 — PORTC bit 0 (second function) |
| Broche 36 | RC1 — PORTC bit 1 (second function) |
| Broche 37 | RC2 — PORTC bit 2 (second function) |
| Broche 38 | RC3 — PORTC bit 3 (second function) |
| Broche 39 | RC4 — PORTC bit 4 (second function) |
| Broche 40 | RC5 — PORTC bit 5 (second function) |
Applications typiques
PIC18F4320-I/P convient pour 6 applications: Industrial Process Control Nodes, Sensor Signal Conditioning with 10-bit ADC, Motor Control with CCP PWM, Battery-Backed Remote Sensor Platforms, Educational and Hobbyist Development Boards, USB/Serial Bridge Firmware.
Industrial Process Control Nodes
The PIC18F4320-I/P fits industrial process-control nodes because its 36 digital I/O on the 40-pin PDIP allow direct wiring of limit-switch inputs, relay-driver outputs, and panel-indicator LEDs without external multiplexers. The 13-channel 10-bit ADC delivers ~4.88 mV LSB at 5 V full-scale, sufficient for 4-20 mA loop sense resistors scaled by 250 ohm shunts and thermistor/PT1000 temperature bridges. Its industrial -40C to +85C temperature range and 2.0-5.5 V supply permit direct operation from 24 V industrial rails down-regulated to 5 V. The CCP modules generate PWM for proportional valve control, and the nanoWatt sleep modes let battery-backed nodes sleep below 1 uA between supervisor scans.
Recommandé
Sensor Signal Conditioning with 10-bit ADC
The PIC18F4320-I/P's 13-channel 10-bit ADC makes it well suited for multi-sensor data-acquisition front ends where each channel digitizes a different transducer (temperature, light, strain, potentiometer). At 5 V VDD the 10-bit resolution yields ~4.88 mV per LSB, adequate for bridge sensors after op-amp gain and for thermistor voltage dividers across 0-70C spans. Acquisition-time and conversion-clock registers (ADCON2) are user-programmable, so designers can trade conversion speed for noise immunity via longer acquisition. The MSSP peripheral streams converted samples over SPI to a host MCU, while the USART offers RS-232/RS-485 wired link as a lower-cost alternative.
Recommandé
Motor Control with CCP PWM
The PIC18F4320-I/P drives brushed DC and small stepper motors using its two CCP modules, which generate 10-bit PWM with programmable frequency, duty cycle, and dead-band control via the PWM steering mode. At 40 MHz the PWM resolution reaches ~10 bits at 39 kHz carrier, suitable for sub-100 W brushed-H-bridge drives and unipolar stepper coils. The 36 I/O include dedicated PWM output pins, direction-control GPIOs, and analog feedback channels for current sensing via the on-chip comparators. Hardware fault inputs trip the PWM output within a single instruction cycle, providing safe shutdown without software latency.
Recommandé
Battery-Backed Remote Sensor Platforms
The PIC18F4320-I/P suits battery-backed remote sensors thanks to its nanoWatt Technology suite: Idle, Sleep, and the ultra-low-power Timer1 oscillator mode drop quiescent quiescent current to sub-1 uA while still waking on interrupt or WDT. Operating from 2.0 V to 5.5 V, it runs directly from two alkaline cells (3 V nominal) or a single Li-ion cell (3.7 V), with the internal brown-out reset protecting against battery end-of-life. The 10-bit ADC with internal 1.2 V bandgap reference enables direct battery-voltage monitoring without external divider components in low-power modes. Self-programming Flash lets the same node receive OTA firmware updates over SPI/UART.
Recommandé
Educational and Hobbyist Development Boards
The PIC18F4320-I/P is widely used in educational labs and hobbyist projects because its 40-pin PDIP through-hole form factor drops directly into breadboards and 0.600 inch DIP sockets - a key advantage over QFN/SOIC packages that require reflow or breakout boards. The on-chip ICD interface allows students to single-step and inspect registers using Microchip's free MPLAB X IDE and PICkit 3/5 programmers, with no external debug-header circuitry required. The 77-instruction PIC18 instruction set, C-friendly architecture, and abundant free XC8 compiler resources make the part a staple of undergraduate embedded-systems curricula. Self-programming lets students bootload bootloader code from the same ICSP pins.
Recommandé
USB/Serial Bridge Firmware
The PIC18F4320-I/P can host legacy serial-bridge firmware converting between RS-232/RS-485 UART traffic and TTL SPI/I2C peripherals, using its MSSP (SPI/I2C) module plus USART. The 8 KB Flash fits common bridge command sets, and the 36 I/O provide enough pins to expose multiple chip-select lines and status LEDs. At 40 MHz the USART sustains 115200 baud reliably with low interrupt overhead. Industrial temperature range and 5.5 V tolerance simplify connection to legacy 5 V equipment in factory-floor retrofits where modern USB-native MCUs are not acceptable.
Recommandé
Récapitulatif des produits recommandés
Données de référence d'ingénierie pour PIC18F4320-I/P — comparaison, recommandations de conception et informations de conformité.
Guide de sélection
Comparaison avec les alternatives
| Paramètre | Ce produit | PIC18F4520-I/P | PIC18F4420-I/P | PIC18F4620-I/P | PIC18F46K22-I/P | PIC18F46K40-I/P | PIC18F4220-I/P |
|---|---|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 40-pin PDIP | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same |
| Program Flash | 8 KB | 32 KB | 16 KB | 64 KB | 64 KB | 64 KB | 4 KB |
| Data SRAM | 512 bytes | 1.5 KB | 768 bytes | 3.96 KB | 3.86 KB | 3.6 KB | 512 bytes |
| EEPROM | 256 bytes | 256 bytes | 256 bytes | 1 KB | 1 KB | 1 KB | 256 bytes |
| Maximum CPU Speed | 40 MHz / 10 MIPS | 40 MHz / 10 MIPS | 40 MHz / 10 MIPS | 40 MHz / 10 MIPS | 64 MHz / 16 MIPS | 64 MHz / 16 MIPS | 40 MHz / 10 MIPS |
| ADC Channels | 13 channels x 10-bit | 13 channels x 10-bit | 13 channels x 10-bit | 13 channels x 10-bit | 28 channels x 10-bit | 35 channels x 10-bit | 13 channels x 10-bit |
| Operating Voltage | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 5.5 V | 2.0 V to 5.5 V |
| PPS (Peripheral Pin Select) | No | No | No | No | Yes | Yes | No |
| Lifecycle Status | Active | Active | Active | Active | Active | Active | Active |
Principaux différenciateurs
- 40-pin PDIP with 36 I/O in the PIC18F4x20 family (vs PIC18F2520-I/SP (28-pin SPDIP))
- Industrial temperature grade at standard pricing (vs PIC18F4320-E/P (extended temperature))
- Mature 10 MIPS PIC18 core with extensive tooling (vs Newer PIC18F46K40-I/P (16 MIPS with PPS))
Notes de conception
Estimated: at 40 MHz and 5 V VDD, PIC18F4320 typical run current is approximately 11-15 mA per Microchip datasheet DS39582B. The dual VDD pins (19 and 31) MUST both be connected, and the dual VSS pins (18 and 32) MUST both be connected, to avoid voltage bounce that causes ADC noise and brown-out misfires. Place a 100 nF decoupling cap within 5 mm of each VDD pin and a single 10 uF bulk cap on the supply rail. For sleep-mode designs, configure the WDT postscaler to extend wake intervals while keeping Timer1 running from its 32 kHz crystal for timekeeping below 1 uA.
The 40-pin PDIP footprint gives generous room for hand routing on 2-layer PCBs but engineers frequently mis-route ICSP pins: MCLR/VPP (pin 1) needs a 10 kohm pull-up to VDD plus a programming header tap to VPP, while PGC (pin 26) and PGD (pin 27) must be reserved for the in-circuit debugger and not loaded with significant capacitance (>50 pF total). The 36 I/O are split across PORTA/PORTB/PORTC/PORTE; ensure ADC inputs AN0-AN13 are kept away from switching nodes to avoid digital-coupling noise on ADC readings, per Microchip datasheet DS39582B section 16.0 'Analog-to-Digital Converter'.
Do not assume the PIC18F4320 and PIC18F4321 are pin-compatible - they belong to different family branches and PIC18F4321 introduces PPS register re-mapping. Always verify against the datasheet DS39582B pinout when migrating firmware across PIC18F43xx variants. Do not exceed 5.5 V on any pin including MCLR during in-circuit programming (ICSP high-voltage mode). Finally, do not drive the 36 I/O above source/sink limits (25 mA per pin, 200 mA per port per Microchip datasheet DS39582B), and ensure external pull-ups on I2C lines use 4.7 kohm or smaller values because the MSSP I/O are not true open-drain on this family.
Informations de conformité
RoHS compliant per Microchip product page. Industrial temperature grade (-40C to +85C) is standard; -E/P extended variant exists for +125C but is not automotive AEC-Q100 qualified. Halogen-free status not explicitly stated in the verified data - default to 'unknown'.