Why PIC Selection Deserves Care

A PIC microcontroller runs the control loop, the interfaces and the housekeeping of a product, so its core, memory, peripherals and package decide what the product can do and how it is built. Choosing too small a part limits the firmware, and choosing too large a part wastes cost. This guide walks through a repeatable method for selecting a Microchip PIC microcontroller.

Step 1: Choose the Core

The core is chosen from the workload. The 8-bit PIC architecture has only 35 single-word instructions and a 200 nanosecond cycle, so it is easy to learn and efficient for a control or an instrumentation task. The PIC18 enhances the 8-bit core with more memory and integration, and the 32-bit PIC32 uses the MIPS32 M4K core with a higher throughput and a larger address space for a demanding application. All share the MPLAB toolchain, so the skills and much of the code carry across.

When to Step Up to 32-Bit

Move to the 32-bit PIC32 when the firmware grows past the 8-bit flash, when the computation or the throughput matters, when the address space must be larger, or when the application needs a feature such as USB plus a large buffer. Below that point the 8-bit part is smaller and cheaper.

Step 2: Size the Memory

Estimate the flash from the code and the constant tables, and the RAM from the stack, the heap and the buffers, then add headroom. The PIC16F877A offers 14 KB of flash and 368 bytes of RAM, and the PIC18F4550 offers 32 KB of flash and 2048 bytes of RAM, so a firmware of moderate size fits the 8-bit parts. Where the data grows beyond the on-chip memory, add a Microchip serial EEPROM or run the code in place from an external memory.

Data Memory

The on-chip EEPROM in the PIC parts stores a small amount of non-volatile data, and a serial EEPROM adds more for the configuration, the calibration and the logs. Keep the critical settings in the protected EEPROM and the large data in the external memory.

Step 3: Match the Peripherals

Count the peripherals you need and confirm the part provides them. The PIC family includes general-purpose and advanced timers with PWM, a capture-compare-PWM module, 10-bit ADC channels, an MSSP module for SPI and I2C, a USART and, on some parts, USB, CAN or Ethernet. Confirm the ADC channel count and the interface count against the design, because a missing channel or interface forces an external part.

USB and Communication

Choose a part with the USB or the communication you need: the PIC18F4550 integrates USB 2.0 full-speed, and the PIC32MX integrates USB on the 32-bit core. The on-chip PLL generates the USB clock, so the interface is straightforward to bring up with the Microchip USB stack.

Step 4: Choose the Package and the Grade

Choose the package from the I/O and the mechanical space, from 8 to 100 pins, and confirm the pin count against the peripheral list. The PIC parts operate over a broad voltage and temperature range, so confirm the grade against the application and check the ESD requirement for the environment.

Step 5: Plan the Software and the Toolchain

Confirm the toolchain, the debug interface and the code library before you commit, because a part without good support wastes engineering time. Microchip provides the MPLAB environment, the XC compilers and a large library of application notes and code examples, so a design is quick to start and the code is portable. Plan the structure and the peripherals early and choose the part that covers the whole plan.

Getting Help

If you send your peripheral list, your code estimate, the interface needs and the mechanical space to our FAE team, we will propose a PIC, help choose the core and the package and review the memory and the USB plan. BeiLuo holds mainstream PIC MCUs in regional stock and ships them with an import declaration, a certificate of origin and a RoHS compliance file, and our engineers will review the choice with you before you commit to production.