Overview

An embedded control design needs a microcontroller that runs the loop and the interfaces, and a small non-volatile memory that keeps the settings across a power cycle. Microchip offers both, with the PIC and AVR microcontroller families and the 24-series and 25-series serial EEPROM, so a designer can source the processor and the memory from one supplier. BeiLuo supplies them with genuine traceability and FAE support. This page shows how the MCU and the EEPROM fit together in a control design.

Choosing the Microcontroller

The microcontroller is chosen from the workload. The PIC family offers a compact 8-bit core with a small instruction set and a broad range from 8 to 100 pins, and the AVR family offers an efficient single-cycle core with a large code library, so both suit an industrial control, an instrumentation or a consumer application. For a simple task the 8-pin ATtiny85 or a small PIC is enough, and for a larger task the PIC18 or the ATmega328P brings more memory and interfaces. The 32-bit PIC32 covers a workload that needs more memory and throughput.

Timers, ADC and Interfaces

The control loop depends on the timers and the analog-to-digital converter, so count the PWM channels and the ADC channels first and confirm the sample rate. The communication interfaces such as USART, SPI and I2C connect the sensor, the display and the memory. Both families provide a rich peripheral set, and the choice often follows the interface count and the package.

The Role of the EEPROM

The serial EEPROM stores the configuration, the calibration and the parameters that must survive a power cycle. Because it uses a two-wire I2C or a four-wire SPI bus, it takes only a few pins and a small package, and it keeps the data for decades without power. A design can move up in density within a family without a board change, because the 24-series and the 25-series share a common pinout. The write-protect feature keeps the critical data safe from an accidental write.

Writing Strategy

Use the page write for an efficient update and the write-protect and the software data protection to guard the critical region. Keep a copy of the settings and a check such as a CRC, so a power loss during a write does not leave a corrupt value, and write to a spare page and switch the pointer only after the write completes.

Power and Cost

For a battery design the low-power modes of the MCU and the low stand-by current of the EEPROM matter as much as the performance. Both families offer low-power modes that a control design can use between measurements, and the serial EEPROM draws very little when idle. The cost is competitive across the range, which suits a consumer or an industrial product.

Toolchain and Code

Microchip provides the MPLAB environment and the XC compilers for both PIC and AVR, with a large library of code and examples, so the development is well supported. Because the code is portable across a family, a design can start on a small part and move to a larger one as the firmware grows.

Layout and Verification

Keep the decoupling close to the MCU and the EEPROM, keep the I2C or SPI traces short and matched and use a ground plane, because a clean interface is what makes the bus reliable across the temperature range and the supply. Verify the design on the bench by reading and writing the EEPROM across the range, by confirming the boot and the reset and by measuring the current in each power mode. Our FAE team can review the layout and the write scheme.

Getting Help

Send your control task, your interface list, your memory and package needs and the environment to our FAE team and we will propose an MCU and an EEPROM, help choose the core and the bus and review the layout. BeiLuo holds mainstream Microchip MCUs and EEPROM in regional stock and ships them with an import declaration, a certificate of origin and a RoHS compliance file, so an embedded control design can move from prototype to production without a supply gap.