Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The PIC16F628A and PIC16F1828 can both be programmed over ICSP with Microchip’s MPLAB X IDE, XC8 compiler, and a supported programmer such as the PICkit 5. They are not software- or pin-compatible, however: create a separate project for each device, use its own configuration bits and pinout, and check its datasheet before wiring or reusing code. For a new design, the PIC16F1828 offers more peripherals and memory; keep the PIC16F628A where an existing circuit or firmware depends on it.

First, identify the exact microcontroller

The part names are PIC16F628A and PIC16F1828; “PIC 16F 16F628A” is a malformed version of the first name. Both are 8-bit Flash microcontrollers, but they belong to different generations and have different register models, configuration words, and package pinouts. Do not assume that a similar name means the same pin assignment.

Feature PIC16F628A PIC16F1828
Family and package Older mid-range PIC; commonly encountered in 18-pin packages. Confirm the exact package diagram in the PIC16F628A/627A/648A datasheet. Enhanced mid-range PIC; 20-pin device. Confirm package details in the Microchip product information and datasheet links.
Program memory 2K instruction words, according to the device datasheet. 7 KB listed by Microchip.
RAM 224 bytes, according to the device datasheet. 256 bytes.
Data EEPROM 128 bytes, according to the device datasheet. 256 bytes.
Analog capability Comparators; no conventional ADC peripheral. 10-bit ADC, up to 12 channels, plus comparators.
Clock and peripherals Older oscillator options; USART and comparator-related functions. Internal oscillator up to 32 MHz; EUSART, SPI, I²C, PWM/CCP and other peripherals.
ICSP Supported. Supported.

The PIC16F1828 product page lists a 1.8–5.5 V operating range and the features above. Check the datasheet’s electrical limits for the conditions and pins in your circuit rather than treating the range as a design guarantee. The PIC16F628A figures are from its device datasheet. Memory figures use the units shown for each device; program memory expressed in instruction words is not directly interchangeable with a byte figure.

Which one should you choose?

  • Use the PIC16F628A when maintaining an existing board, firmware, or legacy assembly project, or when its capabilities are sufficient and hardware compatibility matters.
  • Consider the PIC16F1828 for a new design needing an ADC, more memory, a faster internal oscillator, or its additional serial and PWM peripherals.
  • Choose neither by name alone if a product has strict package, electrical, supply, or certification requirements. The PIC16F1828 is not a drop-in replacement for the PIC16F628A.

Tools for a current development setup

  • MPLAB X IDE manages projects, source files, builds, debugging, and programming.
  • MPLAB XC8 compiles C for 8-bit PIC microcontrollers. Microchip offers a free compiler download and a PRO license option; performance and code size depend on the source and compiler settings. See Microchip’s XC8 overview.
  • PIC-AS is Microchip’s assembler option for PIC assembly projects. Check the device family documentation and migrate legacy assembly carefully; PIC16F628A and PIC16F1828 assembly are not automatically interchangeable. See XC8 device-family information.
  • A supported programmer/debugger, such as PICkit 5, connects the computer to the target. Verify that a specific tool supports the selected device and your installed MPLAB X version.
  • Datasheets and errata give the device-specific pinout, programming requirements, configuration settings, electrical limits, and peripheral behavior. Microchip lists the PIC16F1828 datasheet as DS40001419 and family errata DS80000510 on its product page.

Microchip identifies MPLAB X IDE 6.20 as the final release supporting PICkit 3, MPLAB ICD 3, and MPLAB REAL ICE. Older hardware may still suit a legacy setup, but do not assume it works with a newer IDE or every device. Check Microchip’s MPLAB X page for current tool information. For programming-only production tasks, Microchip describes MPLAB IPE as the more suitable environment; use the IDE when you need to develop or debug source code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Wire the five ICSP connections

In-Circuit Serial Programming (ICSP) uses five signals: clock, data, programming/reset voltage, target supply, and ground. Microchip’s ICSP connection documentation names these ICSPCLK, ICSPDAT, MCLR/VPP, VDD, and VSS.

Programmer signal Connect to target Purpose
MCLR/VPP Device MCLR/VPP Reset and programming-voltage entry.
ICSPCLK/PGC Device programming-clock pin Programming clock.
ICSPDAT/PGD Device programming-data pin Programming data.
VDD Target positive supply, as appropriate to programmer settings Reference or programmer-supplied target power.
VSS Target ground Common electrical reference.

For the PIC16F628A, PGC and PGD are normally RB6/PGC and RB7/PGD. Verify physical pin numbers against the exact package diagram. For the PIC16F1828, use its own datasheet’s ICSP labels and package diagram; do not copy the 628A pin numbers. A programmer’s VDD connection may sense the target voltage or supply it, depending on tool settings. Do not power a complete board from the programmer unless its current and voltage limits are suitable; otherwise use a regulated external supply and common ground.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Keep the programming path electrically clear

  • Keep ICSP traces short and provide a shared ground.
  • Avoid heavy capacitive loads on PGC and PGD. Pull-ups, series diodes, capacitors, and other circuitry on these lines can interfere with programming.
  • Do not let an attached peripheral drive PGC or PGD to an incompatible level during programming; isolate it if needed.
  • Ensure the reset circuit does not clamp MCLR/VPP. Check the device and programmer requirements before adding reset components.
  • If ESD protection is required, follow the board-design guidance for the specific tool and device. Microchip’s ICSP layout guidance warns about line loading and recommends short traces; where a series resistor is used for ESD protection, its guidance says not to exceed 100 Ω.

Install the software and create a device-specific project

  1. Install MPLAB X IDE and MPLAB XC8 from Microchip. Install the appropriate driver or support software for your programmer if prompted.
  2. Connect the programmer and confirm that MPLAB X recognizes it. Check Microchip’s device and tool support if the target does not appear or the hardware is older.
  3. In MPLAB X, select File → New Project, then choose a standalone project for a 8-bit MCU.
  4. Select the exact device: PIC16F628A or PIC16F1828. Do not choose a similarly named part or reuse a project without checking its device setting.
  5. Choose the connected hardware tool, such as PICkit 5, then select MPLAB XC8 as the compiler for a C project.
  6. Create or add a source file such as main.c. Add configuration bits appropriate to that device and circuit.
  7. Build the project and resolve errors before programming. Confirm the selected device and compiler in project properties if device headers or configuration symbols are not recognized.
  8. Connect ICSP and the target supply, then use Run Main Project to build and program. Exact menu labels can vary between MPLAB X releases; Microchip’s programming workflow documentation describes selecting the tool and programming through ICSP.

For a programming-only station, use MPLAB IPE to load and program a verified HEX file. Programming writes the built image to the device; debugging additionally requires compatible debug support and setup for the selected device and tool.

Configuration bits and a first test

Configuration bits determine important behavior before the application runs. At minimum, verify oscillator selection, watchdog timer, brown-out reset, power-up timer where available, MCLR/reset behavior, low-voltage programming, code protection, and debug settings as applicable. The available names and options differ between devices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Use MPLAB X’s configuration-bit interface to generate device-specific settings, or use the device header’s symbols with #pragma config. Inspect the generated configuration output and confirm that it matches the intended clock, reset, and programming setup. Never copy a configuration block from one of these PICs to the other and assume it is valid.

A sensible first application is an LED blink or GPIO toggle, but the source must match the exact chip, package, oscillator, LED pin, and whether the LED is active-high or active-low. For the PIC16F628A, account for comparator functions where they affect the chosen port. For the PIC16F1828, configure the relevant analog-select registers for digital operation, set the pin direction, and choose the oscillator correctly. A single register-level example would be misleading across both devices. Microchip’s XC8 guide explains device-specific registers and peripheral multiplexing; use the relevant datasheet for the actual register sequence.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

C or assembly?

Approach Good fit Trade-offs
C with XC8 New applications, peripheral-heavy PIC16F1828 projects, and maintainable code. Compiler-generated code uses program memory; timing may be less obvious than hand-written assembly, and register setup remains device-specific. Free and PRO modes can produce different size or performance results depending on code.
Assembly Small legacy PIC16F628A programs, cycle-sensitive routines, learning the instruction set, or maintaining existing firmware. Less portable and harder to maintain; banking, paging, interrupt context, and device-family differences create opportunities for subtle errors.

Microchip’s compiler documentation distinguishes device families; the part-number prefix alone does not reliably tell you all compiler or architecture details. Legacy MPASM examples may need adaptation for current tools. Select the assembler and syntax based on the target and current Microchip documentation rather than assuming an older project builds unchanged.

Moving firmware between the two devices

Treat a change from PIC16F628A to PIC16F1828 as a port, not a retargeting click. Peripheral richness does not make the register map a superset, and even source code that compiles can behave differently because of pin functions, clocks, or configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
  1. Select the new device in its own MPLAB X project and regenerate the configuration bits.
  2. Check the physical package and remap every signal against the new pinout.
  3. Rewrite oscillator configuration and recalculate timing, timer prescalers, and delay assumptions.
  4. Replace unavailable or differently named registers; recheck interrupt control and flag locations, including assembly bank-selection logic.
  5. Reconfigure analog/digital selection, comparators, peripheral pin functions, UART, SPI, I²C, PWM/CCP, and timers used by the application.
  6. Review EEPROM access code and interrupt handling against the destination datasheet.
  7. Build with the correct device header, resolve warnings, and test reset behavior, ICSP access, and runtime operation on the actual board.

Troubleshooting programming and runtime problems

Symptom Checks and recovery
“No device detected” Confirm the selected part, VDD/VSS continuity, and voltage at the MCU pins. Check whether the target is powered externally or by the programmer, and verify MCLR/VPP, PGC, and PGD against the package pinout. Disconnect loads from programming pins, remove or isolate interfering capacitors and pull-ups, shorten the cable, and check device/tool compatibility.
Build succeeds but the chip does nothing Check oscillator configuration, MCLR state, watchdog and brown-out settings, GPIO direction, comparator or analog mode, LED polarity, selected HEX/project, and target supply stability.
LED stays on or behaves backwards Check active-low versus active-high wiring, the selected physical pin, output direction, and whether the pin is still assigned to an analog or comparator function.
Random resets Check brown-out and watchdog configuration, supply stability, MCLR noise, and reset-circuit behavior.
Programming works but debugging cannot halt Confirm that the chosen tool and device/package support the expected debug mode, that debug settings are present, and that external circuitry is not loading debug pins. Programming capability does not guarantee the same debug capability.
Firmware works on one chip but not the other Revisit the migration checklist: registers, interrupts, clock and timers, pin assignments, analog selection, comparator setup, EEPROM routines, and configuration words. Treat it as a firmware port rather than a programmer fault.

For the PIC16F1828, Microchip lists integrated debug support and compatible tools on its product page; confirm support for your exact setup. Microchip’s ICSP programming documentation notes that the described programming operation does not require a target clock, so a failed programming connection is not ordinarily fixed by making the application oscillator run first.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.