Sine Triangle Square Saw Burst Sweep Noise – runs on a PIC16F870

Summary of Sine Triangle Square Saw Burst Sweep Noise – runs on a PIC16F870


This article describes a DIY multifunction signal generator built using a PIC16F870 microcontroller and an R/2R resistor ladder for efficient digital-to-analog conversion. The device generates various waveforms like sine, square, and noise via software lookup tables, featuring a 20 MHz clock for high-frequency output. User interaction is minimal, relying on three LEDs, two buttons, and a rotary encoder, requiring an oscilloscope for visual verification of signals.

Parts used in the Signal Generator:

  • PIC16F870 Microcontroller
  • R/2R Resistor Ladder Network
  • Low-pass Filter
  • 20 MHz Clock
  • Three Function LED Indicators
  • Three Step Rate LED Indicators
  • RATE Button
  • Select Button
  • Adjustment Control (Rotary Encoder)

After the recent demise of our multifunction signal generator, we decided to make one of our own.   The circuit uses a PIC16F870 (about $3), an R/2R resistor ladder network (for a real fast and cheap D/A),  and a few other parts.
Sine Triangle Square Saw Burst Sweep Noise - runs on a PIC16F870
You can check out the schematic and the current source file.  Also the object (hex) file.  All of the sine wave functions utilize a full 256 byte by 8 bit lookup table.  Contrary to what you may have heard elsewhere, it is possible to use a full memory page in the PIC for a lookup table – check it out.

The only real elaboration was the design of the low-pass filter.  With the present design running on a 20 mhz clock, you can get over 60 khz of very clean sine waves.  The frequency is adjustable in 1, 25, and 500 hz steps.  The unit produces accurate frequencies down to 1 hz.

Since all of the waves are generated in software, the ‘user interface’ had to be kept to a minimum.  Three LED’s indicate the functions (which vary depending on the type of wave being generated).  Three more LED’s indicate the step rate of the adjustment control. Sine Triangle Square Saw Burst Sweep Noise - runs on a PIC16F870 schematic  Pushing the RATE button advances to the next step rate and pushing the select button goes to the next function.

The wave function itself is selected by holding down the select button while rotating the adjustment control.   Since there is no visible indication of the wave type or frequency, you need to have a scope hooked up to see what you are doing.

 

 

 

For more detail: Sine Triangle Square Saw Burst Sweep Noise – runs on a PIC16F870

Quick Solutions to Questions related to Signal Generator:

  • What microcontroller is used in this project?
    The circuit uses a PIC16F870.
  • How are the sine waves generated?
    All sine wave functions utilize a full 256 byte by 8 bit lookup table stored in memory.
  • What determines the maximum frequency of the clean sine waves?
    With the design running on a 20 mhz clock, you can get over 60 khz of very clean sine waves.
  • How is the frequency adjusted?
    The frequency is adjustable in 1, 25, and 500 hz steps.
  • How do you select the wave function?
    The wave function is selected by holding down the select button while rotating the adjustment control.
  • What components indicate the current step rate?
    Three more LED's indicate the step rate of the adjustment control.
  • Why is an oscilloscope necessary for this project?
    You need to have a scope hooked up to see what you are doing since there is no visible indication of the wave type or frequency.
  • Does the unit produce accurate frequencies at low settings?
    Yes, the unit produces accurate frequencies down to 1 hz.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter