PIC based Oscilliscope

Summary of PIC based Oscilliscope


This article outlines the design of a microcontroller-based oscilloscope. The project aims to sample input signals via an ADC at consistent intervals and display waveforms on a graphical LCD. Key components include a dsPIC33FJ128GP802 microcontroller for high-speed sampling and processing, a 4-inch touch screen LCD, and an AR1010 dedicated touch controller to preserve microcontroller resources. Signal conditioning involves a voltage divider network and operational amplifiers to scale down higher voltages safely for the 3.5V microcontroller.

Parts used in the Microcontroller Oscilloscope:

  • dsPIC33FJ128GP802 microcontroller
  • 4 inch graphic LCD with touch screen
  • AR1010 touch screen controller
  • Voltage divider network
  • Operational amplifier (Opamp)
  • DMA (Direct Memory Access) capability

I have seen many examples of microcontroller oscilliscopes on the web and have had an itch to build one myself.  In order to accomplish this my initial thought is to sample an input (ADC) at consistant time increments and then display the waveform on a graphic lcd display.  If I want to change the time scale I can just change the rate of time between samples, and if I want to increase the voltage scale I can scale the measured values by some multiple.

PIC based Oscilliscope

 

With that basic concept, this project will require an ADC, microcontroller, graphic lcd, and some form of input.  After doing a bit of search for the LCD display this link was selling a 4 inch display with touch screen for a mere $25 (which is dirt cheap for that type of resolution if you check sparkfun or other website).  So now I had the display and the input source, though more thought will be needed to have graphical interface, the next item to tackle was the ADC.  I had a few 24bit Microchip microcontrollers that had onboard ADC that could sample at 1.1 Msps, as they were designed to be optimized for digital signals.  Not only that but they can sample multiple channels at one time which would be good for a two channel oscilliscope (if I decide to upgrade later on).  The chip is a dsPIC33FJ128GP802, and it also has the capability to do sampling in the background while filling up an onboard DMA so that the only work in code will be to draw the display, plot the data, and handle inputs.  The dsPIC33 is a 16 bit processor as opposed to the 8 bit processors which makes math on larger values much easier and quicker.  On that same note, it also can run up to 40 MIPS so there should be plenty of speed if math operation may be needed to do an FFT or other analysis of data.

Initially in testing I was interfacing the touch screen with an onboard ADC of the microcontroller, but after thinking about how that ties up a resource I decided to go with a dedicated touch screen controller the AR1010, which is another Microchip product.  I’m not trying to show a bias, I was able to get free samples of both chips (uC and Touch Controller) so they kept the budget low, and I really like the organization of datasheet put out by Microchip.

There is still one looming problem, and that is the fact that the dsPIC only works at voltage levels of 3.5 volts.  This isn’t very useful if 5/12/24 volt waveforms want to be analyzed (I left out 120 because of safety issue that I don’t want to mess around with).  So in order to scale down the signal I’ll need some sort of voltage divider network and an opamp to isolate and match the impedance of the dsPIC’s ADC input.  Basically I would rather destroy a generic op amp before I hurt the main controller of this project.  An idea I found from Texas Instrument was this, and I have ordered samples of their opamps to try and design this circuit but they don’t come in a DIP package.  Another idea I found was here, which is from an AVR base oscilliscope and it just uses some generic opamps.

Read More:   PIC based Oscilliscope

Quick Solutions to Questions related to Microcontroller Oscilloscope:

  • How does the author plan to change the time scale?
    The time scale is changed by adjusting the rate of time between samples.
  • What chip was chosen for the analog-to-digital conversion?
    The dsPIC33FJ128GP802 microcontroller was selected for its onboard 24-bit ADC capable of sampling at 1.1 Msps.
  • Why did the author choose the AR1010 over the microcontroller's onboard ADC for the touch screen?
    The dedicated AR1010 controller was chosen to avoid tying up the microcontroller's onboard ADC resources.
  • What is the operating voltage limitation of the dsPIC33 microcontroller?
    The dsPIC33 only works at voltage levels of 3.5 volts.
  • How will the circuit handle input signals higher than 3.5 volts?
    A voltage divider network and an opamp will be used to scale down the signal and isolate the impedance.
  • Can this oscilloscope support multiple channels?
    Yes, the selected microcontroller can sample multiple channels simultaneously, allowing for potential upgrades to a two-channel scope.
  • What is the maximum processing speed of the dsPIC33 mentioned in the text?
    The dsPIC33 can run up to 40 MIPS.
  • Why are operational amplifiers preferred over destroying the main controller?
    The author prefers to destroy a generic opamp rather than damage the main controller when scaling voltages.

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