29 January 2009

PIC Microcontrollers for Digital Filter Implementation

HAPTER-2 There are many devices using which we can implement the digital filter hardware. Gone are the days where we still use discrete components to implement multiply, accumulate and delay units. With the advent of VLSI technology, now implementations of digital filters have become easier. A single IC can provide required hardware support.

Digital filters can implemented on different platforms like general-purpose processors (e.g.: 8086 and higher versions), microcontrollers, and DSP controllers or on specially designed digital signal processors like TMS 320CXX series.

Microcontrollers can be used for low frequency applications and where there is finest response and high speed is not required. To increase the speed to medium level, for good filter response and to accomplish floating point arithmetic operations DSP controllers can be utilized. Specially designed DSP processors optimized for very high speed of operation and since it is exclusively meant for DSP applications, software instructions are available to implement many DSP operations. Thus filter implementation of DSP theories are concerned, DSP processors are well suited for all applications. But cost of DSP processor is high.


A microcontroller is a general-purpose device but meant to read data, perform limited calculations on that data, & control its environment based on these calculations. The prime use of a microcontroller is to control operations throughout the lifetime of the system.

The microcontroller uses a much-limited set of single and double byte instruction that are used to move code from internal memory to the ALU.


The PIC16F877 family of microcontroller use what is called a Harvard architecture to achieve an exceptionally fast execution speed for a given clock rate. As shown in figure, Instructions are fetched from program memory using buses that are distinct from the buses used for accessing variables in that memory, I/O ports, etc. Every instruction is coded as a single 14-bit word and fetched over a 14-bit-wide bus. Consequently, as instructions are fetched from successive program memory locations, a new instruction is fetched every cycle.


The CPU executes each instruction during the cycle following its, pipelining instruction fetches and instruction execution to achieve the execution of one instruction every cycle. It can seen that while each instruction requires two cycles (a fetch cycle followed by an execute cycle), the overlapping of the execute cycle of one instruction with the fetch cycle of the next instruction leads to the execution of a new instruction every cycle


The key features or the core features of PIC16F87XA microcontroller include:


  • Only 35 single word instructions to learn

  • All single cycle instructions except for program branches, which are two – cycle

  • Operating speed: DC-20MHz clock input

DC-200ns instruction cycle

  • Up to 8K*14 words of FLASH Program Memory,

Up to 368*8 bytes of Data Memory (RAM),

Up to 256*8 bytes of EEPROM Data Memory

  • Pin out compatible to other 28-pin or 40/44-pin PIC 16CXXX and PIC16FXXX



  • Timer 0: 8-bit timer/counter with 8-bit prescalar.

  • Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via External crystal clock

  • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

Two Capture, Compare, PWM modules

-Capture is 16-bit, max. Resolution is 12.5ns

-Compare is 16-bit, max resolution is 200ns

-PWM max. Resolution is 10-bit

  • Synchronous Serial Port (SSP) with SPI (Master mode) and I2 C (Master/Slave)

  • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection

  • Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls

(40/44-pin only)

  • Brown-out detection circuitry for Brown-out Reset (BOR)


  • 10-bit, up to 8 channels Analog-to-Digital Converter (A/D)

  • Brown-out Reset (BOR)

  • Analog Comparator module with:

  • Two analog comparators

  • Programmable on chip voltage reference (VREF) module

  • Programmable input multiplexing from device inputs and internal voltage reference

  • Comparator outputs are externally accessible


  • 100,000 erase/write cycle Enhanced FLASH program memory Typical

  • 1,000,000-erase/write cycle Data EEPROM memory typical

  • Data EEPROM Retention>40 years

  • Self-reprogrammable under software control

  • In-Circuit Serial Programming (ICSP) via two pins

  • Single supply 5V In-Circuit Serial Programming

  • Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation

  • Programmable code protection

  • Power saving SLEEP mode

  • Selectable oscillator options

  • In-Circuit Debug (ICD) via two pins


  • Low power, high speed FLASH / EEPROM technology

  • Fully static design

  • Wide operating voltage range (2.0V to 5.5V)

  • Commercial and Industrial temperature ranges

  • Low power consumption



1. PIC 16F87XA Data Sheet

2. Embedded Control Handbook-1994/95/Microchip

3. Microchip Technical Library CD-ROM-First Edition 2002

4. “Design With PIC Microcontrollers” By John B.Peatman

5. www.microchip.com


  1. i would like to know how a particular frequency pattern is filtered form a given audio in real time systems using pic microcontrollers
    -- REJIRAM R
    email == rejiramnair@gmail.com



Your Comments... (comments are moderated)