Welcome!
...
News
2023 3RDQ

Pass The Torch - Part 3: Economics

10min

๏ปฟ

Part 4:Economics
Part 4:Economics
๏ปฟ

Lead In

In this installment, we will consider the economics and basic factors in changing a device in a design. These should help with evaluating the need, however, each design has its own requirements.

When comparing the two devices they were released at very different times in MCU development. The PIC16F887 with all the classic hallmarks of its time. It's not necessarily orientated for low-power design best practices and can be seen as a bit limited in terms of available peripherals.

The PIC16F18875 while still an 8-BIT device, and coming from the same design house has many features synonymous with the advancing 32-BIT stables. There are core independent peripherals, a far more extensible AD capability, and so on.

To cover the basics, we will compare the cost and logistics involved in adopting the new device.

The per-device cost

A cursory Octopart search provided the following prices. This is for the same 44PIN TQFP I/P package.

  • PIC16F887 at roughly $3.3
  • PIC16F18877 at roughly $1.9

The prices quoted are QTY 1, as per DigiKey's stock and inventory.

Initially, the impetus to change may be obvious on the cost alone. For mass production purposes, the difference in price makes it worthwhile. The MCU as a single-item BOM change reduces the cost per item ~40%.

Implementation

See the section entitled Your Tool Box๏ปฟ for a deeper look at this topic.

Implementing the device initiates the process of converting the project's MCU. The new device's PIN layout, thanks to Microchip's forward compatibility strategy means that the PINs will match, and where they don't the PPS feature enables pin remapping to some extent.

While we can say it's a "drop-in replacement", to some extent, to ensure that the device functions two things will have to happen. The device's code would need to be updated to:

  1. Work on the new device without changes, ie run as if it were on a PIC16F887
  2. Ensure that the new hardware does, not work with the code
  3. Any updates and changes don't break what is already working

Our embedded developers in other words would need to "learn" to use the new device.

Programming Hardware

The PIC16F887 uses an older toolchain, where the PICKIT2, PICKIT3, and PICKIT4 along with the PICKIT 5 would be able to program it. Most of us may have access to a PICKIT2, a clone, or perhaps even the PICKIT3. When moving to the PIC16F18875/7 as a newer device, there would be a need for an updated compiler along with the required programming tools - it's been a while since the

If you have a PICKIT, only the PICKIT 4 is still available new from Microchip and is currently being replaced by the PICKIT 5. You may have to outlay some money to obtain the hardware needed to flash a device.

It would be best to get in contact with your regional Microchip representative for assistance.

๏ปฟ

While many PICs do support bootloaders, the device still requires first-time programming to install the bootloader which requires the PICKIT.

Compiler / Development Software

Fortunately, the software requirement can be solved easily as Microchip's MPLABx IDE is freely available. The developer would need to download the IDE and then install the compilers from Microchip.

We have so far successfully used the MikroC compiler and would recommend this as an option to consider.

See the links below.

Mikroe: MikroC๏ปฟ

Learning Curve

At this point, we have noticed a number of similarities with the PIC18F45K22 with regard to the port setup, you write to the latch. While it's early days, the feeling has been that if you are familiar with the PIC18F45K22, then you have a good starter knowledge of the PIC16F18875/7. You are not moving backward, more of a sideways move.

Lead Out

Finally, we will move on to the more hard-core enhanced features of the device in Part 4.