1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

USB DSO: The Back End Design

Discussion in 'BoM Blogs' started by Blackthorne TA, Mar 16, 2012.

  1. Blackthorne TA

    Blackthorne TA Master in his Own Mind Staff Member ★ SPS Account Holder Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!)

    Joined:
    Oct 19, 2000
    Messages:
    10,415
    Media:
    40
    Likes Received:
    232
    Gender:
    Male
    What exactly is the back end of my USB DSO, and how does it do what it does?

    Put simply, it is the digital part of the DSO after the analog signal to be measured has been conditioned and readied for sampling. It includes the USB connection so it can be connected to a computer for both the power source and interfacing, a SoC to handle the control of everything and any necessary processing, an analog to digital converter (ADC) to digitize the analog signal coming in, a trigger circuit that controls when to start capturing samples, and a first-in first-out (FIFO) memory for holding the digitized samples.

    Let's start at the USB connection which is J2 on the schematic. J2 is actually a dual-purpose connector. First it connects the 4-wire USB signal set of power (Vdd), ground (GND) and the two USB serial data wires (D+ and D-) to the SoC. Second, it connects the standard 5-wire interface for the Cypress SoC programmer.

    Which brings us to the Cypress CY7C63823-SXC SoC labelled U1 on the schematic. This small System on Chip (SoC) is an amazing piece of tech compared to what I had to work with in my University days. It includes a small 8-bit microcontroller, a USB Low Speed Serial Peripheral Controller engine, 256 bytes of RAM, 8 KB of Flash PROM and several what they call General Purpose I/O (GPIO) which can be programmatically configured to be any one of several input and/or output types brought out to pins of the device. It's really a small, simple embedded computer all on single chip! It doesn't even need an external crystal oscillator for its clock source(which most microcontrollers do). So this is the central "brain" of the DSO whch handles the control of all the rest of the devices as well as the USB interface to a computer, and you can see all the connections it has all over the place on the schematic.

    The Analog Devices AD9057 ADC is labelled U4 on the schematic. This is an 8-bit ADC that can sample a voltage range between 2 and 3 volts at a rate of up to 40 million samples per second. Given the 8-bits (256 possible values) and the 1-volt range, you can see that each sample has a resolution of about 4 millivolts. The analog signal comes it at the AIN pin from Port 1 on the schematic and the signal at the ENCODE pin drives the sample frequency. The 8-bit digitized values of the input voltage are provided at the output pins D0-D7.

    The Integrated Device Technology 7204 4K x 9 bit FIFO memory is labelled U3 on the schematic. It is a 9-bit (of which only 8 bits are used) high-speed FIFO memory that can handle the 40 MSPS of the ADC and holds 4096 samples. How a FIFO memory works is that data can be written to and read from it at different rates and times, and it maintains its own internal pointers to know where the next locations are for reading and writing. And as the name implies, the first piece of data written to the memory is also the first one read (no matter how many other writes had completed). It will also give indications when it has become empty or full (and even half-full). The write frequency is driven by the input on the W-not pin, while reads are controlled by the SoC via the R-not pin.

    The part labelled U2 is a 2x4-bit multiplexer which was needed just because the SoC didn't have enough inputs to allow me to receive all 8 bits of a sample from the FIFO at one time. So by using the 74ACT157, I could get 4-bits at a time instead.

    The part labelled U5 is a MAXIM DS1077 programmable clock source. It is used to provide a constant 33MHz sampling rate to the ADC, and a variable (programmed by the SoC) write frequency to the FIFO memory. The reason for this is that high speed ADCs due to their designs have a minimum sample rate which was much to high for the purposes of the wide range of frequencies I wanted to support with my DSO. Thus the ADC is always digitizing at a high rate, but the FIFO memory could be capturing only a small fraction of those samples.

    The set of four parts in the upper left section of the schematic form the trigger. A trigger helps the user to only start capturing samples when they are of interest. For example if a signal of interest is at an uninteresting zero volts most of the time, but has brief periods of interesting voltage changes, it would be difficult to capture only the interesting parts if there weren't some sort of way to control when the DSO started capturing the data. This control is typically by voltage level and whether the signal is rising or falling. The Microchip TC1320 is a programmable digital to analog converter (DAC) (labelled U10) which provides a voltage level programmed by the SoC to the Analog Devices AD8611 voltage comparator. A voltage comparator takes two analog voltages and compares them. If one is higher than the other, it outputs a high signal on one output, otherwise it outputs a low signal. It also has another output which output the opposite level as this first output. So one end of the comparator has this programmable voltage as an input while the other input is the voltage being sampled by the DSO (coming in at Port 1 of the schematic). The two outputs are connected to a 2-to-1 multiplexer (the NCSZ157P6X labelled U8 that Gaear was so enamored with :) ) which lets the SoC choose which output to pass on to the clock input of the 74ACT74 D-type flip-flop labelled U7. What this does is allow for choosing a rising or falling signal at a certain voltage level as the trigger. The output of the D-type flip-flop controls the enable of the clock signal produced by the DS1077 that drives the write pin of the FIFO memory. Thus, the FIFO memory does not begin writing samples from the ADC until this trigger circuitry identifies that the voltage is of the appropriate level and is rising or falling.

    All that's left on this schematic is the bit of circuitry on the far right composed of some discrete parts and the Texas Instruments LM2735 boost regulator which simply takes the power supply voltage from the USB bus and boosts and regulates it to 5 volts for the rest of the DSO circuitry.

    So there you have it! The back end design of my USB DSO. Feel free to ask any questions you may have and I'll answer them the best I can in either comments or another blog entry.

    Stay tuned! Coming up is the front end design and schematic! :)
     
  2. Gaear

    Gaear ★ SPS Account Holder Resourceful

    Joined:
    Nov 13, 2006
    Messages:
    1,877
    Media:
    13
    Likes Received:
    180
    I actually read this, for the record. ;)
     
  3. Blackthorne TA

    Blackthorne TA Master in his Own Mind Staff Member ★ SPS Account Holder Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!)

    Joined:
    Oct 19, 2000
    Messages:
    10,415
    Media:
    40
    Likes Received:
    232
    Gender:
    Male
    Appreciated. :)

    Did it make sense? Anything not clear, or want additional explanation?

    I'm not sure what level would be best understood by those who would actually take an interest and the time to read it. :)
     
  4. Gaear

    Gaear ★ SPS Account Holder Resourceful

    Joined:
    Nov 13, 2006
    Messages:
    1,877
    Media:
    13
    Likes Received:
    180
    Well I suppose most of it's unclear to me but that's no fault of yours. ;)

    Does this have to do with your line of work in RL, BTA?
     
  5. Blackthorne TA

    Blackthorne TA Master in his Own Mind Staff Member ★ SPS Account Holder Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!)

    Joined:
    Oct 19, 2000
    Messages:
    10,415
    Media:
    40
    Likes Received:
    232
    Gender:
    Male
    Not exactly. I do embedded software though which is part of this project (which I haven't covered at all). My University training was in Electrical and Computer Engineering. Mostly digital, so the analog work I did on this project was fairly new as far as real experience goes, so I learned a lot.
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.